tumtumtum / StreamingKit

A fast and extensible gapless AudioPlayer/AudioStreamer for OSX and iOS (iPhone, iPad)
Other
2.43k stars 525 forks source link

m4a files not playing consistently #84

Open rkrasser opened 10 years ago

rkrasser commented 10 years ago

I'm wanting to use StreamingKit for iOS to HTTP stream audio files. These files are of varying formats, i.e. mp3, wav, m4a... It's performing very well, except that it doesn't consistently play m4a files. Specifically, it's having trouble with ones that were created using QuickTime Player. It does play other m4a files though. From what I can tell, it appears that the player thinks it's reached the end of the file before it plays anything.
I've tried playing these files in the ExampleApp (for iOS) you provided. It plays this one fine http://zookeyfiles.wrightract.com/BERRIGN%20road.m4a, but not this one http://zookeyfiles.wrightract.com/Krasser/Jupiter.m4a. Any help you could give me would be much appreciated.

tumtumtum commented 10 years ago

It appears that your m4a file wasn't optimised for network streaming (the header is not at the beginning of the file). AudioFileStreamParseBytes is giving kAudioFileStreamError_NotOptimized as an error. At the moment, STK is optimised for linear data sources (non random access if you're not seeking). Support will have to be added to use these types of files.

I've been considering moving the packet parsing aspect of the audio player out into the data sources in a future version which make this a lot easier. I don't expect this to be done in the next few weeks tho.

rkrasser commented 10 years ago

Thanks for the quick response. I'll look into what needs to be done to optimize files for streaming.

syrakozz commented 9 years ago

@tumtumtum we miss you :) hi , any update for this issue, its very important ,

etamity commented 9 years ago

:+1: , I am getting this Parse bytes failed. err: optm 1869640813

newbdez33 commented 7 years ago

I'm trying to fetch moov tag manually then setup STKQueueEntry.audioStreamBasicDescription and audioDataOffset with out AudioFileStreamParseBytes. but I'm not sure if it will work.

And I tried it's not working. I cannot get 'handleAudioPackets' callback called.

Any suggestion?