Hi there,
I’ve had a number of e-mails from people using our app on Sony Experia devices running Android 7 who have claimed that the audio record function within our app isn’t working all the time.
We couldn’t replicate on any of our Android devices, so we bought a Sony Experia phone and sure enough, the audio recording only works about 40% of the time.
No error comes up when recording, but I see the following error when trying to play back a failed recording:
04-25 14:39:05.660 32321 32371 I Corona : WARNING: audio.loadSound() failed to create sound ‘word-1.wav’
This code has worked fine for 3 years on Android devices but with Android 7 we are starting to see this issue. The really frustrating thing is that the problem is sporadic - it happens 3 times in a row and then the recording works fine, with no difference to what I’m doing.
Recording:
local filePath = system.pathForFile( "word-1.wav", system.DocumentsDirectory ) r = media.newRecording( filePath) r:setSampleRate(44100) r:startRecording()
Play back:
local sound = audio.loadSound( "word-1.wav", system.DocumentsDirectory ); local sChannel = audio.play( sound, { onComplete = nil } );
If anyone else has experienced this or has any ideas that would be really helpful.
Thanks in advance,
Ian