Working with Sound

Hi

I am working on a project which requires to record a voice memo, store the file in our cloud database and then make the memo available on other devices to listen to.

I can do the basic stuff of recording a user with the media library and then playing it back using the audio library, storing a file is fine, however I have two issues on the horizon I could do with your help on.

  1. When I am recording I am not able to provide any realistic feedback to the user of whether the device is picking up thier voice. At present I just flash a recording icon (using transition.blink), but what I would like is to detect the volume of the voice through an event and display a small sound bar chart which increases and decreases as they speak. Are there any events I can hook into whilst a recording is taking place to indicate that words are being spoken? This is a nice to have, as I could always just animate a pretend sound bar…

  2. This issue is more serious. If the user is using Apple IOS then the file created is an Aif file. If another user is using an Andorid tablet device, how can they the play this file? And vice versa. My thinking is to do some kind of conversion when the user requests the sound file to ensure it can be played on the device being used. Has anyone come up with an elegant solution to this problem?

Thanks for your help as always, Matt

One obvious solution would be to do server-side conversion of every file into “the other” version when uploaded, so you have both version on file when needed. It uses more space, but then again, if your app is successful you will have the budget for this - server space is not that expensive.

Thanks for that. The audio library on corona sdk will play WAV files so all I have to do is convert my Aif files to WAV and store these. Have not found a way of doing this on the device, but there is an open source .net library called naudio (http://naudio.codeplex.com/documentation) which does have a Aif to WAV function call. Have not tested this yet, but my thinking is to all this function server side and then store the created WAV file. Everything should then play the WAV. Thanks for helping me think this one through…

One obvious solution would be to do server-side conversion of every file into “the other” version when uploaded, so you have both version on file when needed. It uses more space, but then again, if your app is successful you will have the budget for this - server space is not that expensive.

Thanks for that. The audio library on corona sdk will play WAV files so all I have to do is convert my Aif files to WAV and store these. Have not found a way of doing this on the device, but there is an open source .net library called naudio (http://naudio.codeplex.com/documentation) which does have a Aif to WAV function call. Have not tested this yet, but my thinking is to all this function server side and then store the created WAV file. Everything should then play the WAV. Thanks for helping me think this one through…