I'm working on an app that uses EZAudio to get audio data from microphone to send it over wifi, then records the received audio data on the 2nd device. Everything works great however when i tried to use EZRecorder from their example file, i get this error: "Error: Failed to set client format on recorded audio file (-66563)". I should mention that the original example code works without an issue on its own but i get an error when i move the code to my project.
Any help is appreciated.
Here's the piece of code that causes this:
-(void)toggleRecording:(id)sender
{
if (recTest==0)
{
[recButton setImage:[UIImage imageNamed:@"rec2.png"] forState:UIControlStateNormal];
recTest=1;
}
else if (recTest==1)
{
[recButton setImage:[UIImage imageNamed:@"rec.png"] forState:UIControlStateNormal];
recTest=0;
}
self.playingTextField.text = @"Not Playing";
if(self.audioPlayer)
{
if(self.audioPlayer.playing)
{
[self.audioPlayer stop];
}
self.audioPlayer = nil;
}
if(recTest==1)
{
//Create the recorder
self.recorder = [EZRecorder recorderWithDestinationURL:[self testFilePathURL]
sourceFormat:self.microphone.audioStreamBasicDescription
destinationFileType:EZRecorderFileTypeM4A];
self.isRecording = NO;
}
else
{
[self.recorder closeAudioFile];
self.isRecording = YES;
}
self.recordingTextField.text = self.isRecording ? @"Recording" : @"Not Recording";
}
As for my knowledge is concerned you have to delete the previously recorded audio. Here is sample code that I used to delete audio,
Hope this may give some idea about your issue.