lundi 17 avril 2017

Android: Generate audio file containing random numbers to be played through earspeaker

I'm working on a project where I need to do the following:

  • Generate 4 random numbers (each number is between 1-9)
  • Generate an audio file with the generated numbers "pronounced" by a "voice"
  • Ask the user to input those numbers using the phone's keypad
  • Match the played numbers with user input and determine if they match

The only way I can think of to go about this is the following:

  • Record individual numbers in separate audio files(1, 2, 3, etc, each in a separate audio file)
  • Generate 4 random numbers (each number is between 1-9)
  • Compile the corresponding numbers in one audio file (using the individual audio files of each number)
  • Ask the user to input those numbers using the phone's keypad
  • Match the played numbers with user input and determine if they match

Now, this method didn't set right with me as I think there's a better way to go about this. Can I achieve the same thing without having to record individual numbers in separate audio files and then recompile those files into one audio file depending on the random numbers generated programmatically?




Aucun commentaire:

Enregistrer un commentaire