EZAudioPlayer with HTTP streaming URL not working
eyeezzi opened this issue · 0 comments
eyeezzi commented
TLDR; How do i use EZAudioPlayer with a HTTP Streaming URL?
My goal is to display the waveform of a live HTTP stream in realtime. I have a streaming URL like http://myradio.com/listen, which works fine in browsers. After reading the documentation, I figured I'll do this in 2 steps:
- Create an
EZAudioPlayer
initialized with my streaming URL and set player delegate to self.
[EZAudioPlayer audioPlayerWithURL:<my_url> delegate:<self>]
- Then implement the
EZAudioPlayerDelegate
method below in which I update my EZAudioPlot view.
-(void)audioPlayer:(EZAudioPlayer *)audioPlayer playedAudio:(float **)buffer withBufferSize:(UInt32)bufferSize withNumberOfChannels:(UInt32)numberOfChannels inAudioFile:(EZAudioFile *)audioFile {
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.audioPlot updateBuffer:buffer[0]
withBufferSize:bufferSize];
});
}
However, I cannot get past step 1 because the EZAudioPlayer will not initialize with a HTTP streaming URL, I suppose it is checking for file existence and simply failing since the url is not a local file. How can I remedy this? Thanks.