I would like to play a sound file downloaded from the Internet, so I tried to start with the SpeakHere iPhone SDK example. I recorded the sound, then saved and uploaded to the Internet, I could download this file and play sound instruments without any problems. But when I tried to reproduce this URL from SpeakHere, I get an error Program received signal: "EXC_BAD_ACCESS".
After tracing, I found that in -[AudioPlayer calculateSizesFor:]it I set bufferByteSizeto a huge number 806128768, which caused the buffer allocation to fail.
And this is because in
AudioFileGetProperty(audioFileID, kAudioFilePropertyPacketSizeUpperBound, &propertySize, &maxPacketSize);
Returns maxPacketSize806128768.
I am wondering how to do the job AudioFileGetProperty.
My sound file is here , you can right-click and download from here .
I use this method to set the url in a method -[AudioViewController playOrStop]:
AudioPlayer *thePlayer = [[AudioPlayer alloc] initWithURL:
[NSURL URLWithString: @"http://chineseresume.com/localbiz/uploads/myfilename_7_Recording.caf"]];
Any suggestion is welcome.
source
share