Reputation: 8810
I am using an Audio streamer into my application.I am getting the audiofile form the server and playing it using audio streamer.The url is like http://182.18.140.134/ExpressPlus/audio/356108042705526/teja.mp3 when I try to play this audio its generating an alert as "Parse bytes failed. err: optm 1869640813".
Guy's any idea how to resolve it?
Thanks to all, Madan.
Upvotes: 4
Views: 1523
Reputation: 26652
AudioFileStreamParseBytes
expects to receive a stream that has been optimised for network transmission. So, for example if you were exporting the file using AVAssetExportSession
, you would set this as follows:
AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset: songAsset
presetName: AVAssetExportPresetPassthrough];
exporter.shouldOptimizeForNetworkUse = YES;
I guess in your case you need to look at how the MP3 is generated and check if the flag is being set.
If that doesn't help, have a look at Matt Gallagher's tutorial on this:
Streaming and playing an MP3 stream
He covers issues that might cause a crash whilst parsing MP3 files.
Upvotes: 1
Reputation: 662
The documentation states for that message:
It is not possible to produce output packets because the streamed audio file's packet table or other defining information is not present or appears after the audio data.
It's in the Result Codes section. Result Code is kAudioFileStreamError_NotOptimized. That message is kinda vague but it seems like the header information for the audio is not at the beginning of the file as expected. You should try examining the audio file being returned to see how it's setup.
Upvotes: 0