Open tomaszwojcik opened 9 years ago
maybe it can help to somebody. example for local file. ` -(void) audioPlayer:(STKAudioPlayer)audioPlayer didFinishBufferingSourceWithQueueItemId:(NSObject)queueItemId {
QueueID* queueId = (QueueID*)queueItemId;
MPMediaItem *item // yours next song
NSURL *url = [item valueForProperty:MPMediaItemPropertyAssetURL];
[audioPlayer queueDataSource:[STKAudioPlayer dataSourceFromURL:url]
withQueueItemId:[[QueueID alloc] initWithUrl:queueId.url andCount:queueId.count + 1]];
} `
Hey
I'm trying to perform a gapless streaming via TCP (I'm parsing packets that contain MP3). For that task I've created a custom data source that accepts NSData, and is basically same as
STKLocalFileDataSource
with the following differences:Custom constructor:
Changes in the
open
method:When I enqueue data sources, the sound is not gapless, there is some kind of error like a micro gap. Moreover, after some time (varies, sometimes 5 seconds, other times 10 seconds) the sound stops playing.
I have checked if this was a network/packet parsing fault and it's not. Instead of queueing the MP3's to STK player I saved the packets data to file and then played the file - everything was smooth and without errors.
Any ideas what am I doing wrong?