- Home /
Why does the iPad 1 audio mute?
Hey guys,
Having some issues here with the audio recorder by Prime31 when being used on the first Gen iPad. Completely unsure as to why this is happening as my code seems to be very similar to the example, and more confusingly it is working fine on the second Gen iPad. It also seems to be a bit random. Below is a snippet of the code i have written to record audio.
function Record()
{
error = AudioRecorderBinding.prepareToRecordFile( "t0.wav" );
if( error.Length > 0 )
Debug.Log( "failed to prepare audio recorder: " + error );
else
{
//Record the audio file for duration
var didRecord : boolean = AudioRecorderBinding.recordForDuration( 60 );
Debug.Log( "audioRecorderRecordForDuration: " + didRecord );
}
}
As far as i can tell it shouldn't have any errors. It prepares an audio file, checks the error length, if its not greater than 0 it starts to record for a duration. This all works, i check the debug spam and it reports:
audioRecorderRecordForDuration: True
When i stop the audio through another button, i use the following code:
if(AudioRecorderBinding.isRecording())
{
AudioRecorderBinding.stop( true );
}
This code should stop the audio recording and finish it off. After this i check the debug spam and i receive a line:
audioRecorderDidFinish event: file://.../t0.wav
Which is the callback to check when encoding is completed. More often than not, after all of this happens the system audio mutes for the app. I need to suspend the app, and go back into the app again to get audio back again.
Any ideas?
Thanks.