tumtumtum / StreamingKit

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

How to get the http audio stream metadata #27

Open Tommecpe opened 11 years ago

Tommecpe commented 11 years ago

I'm currently using AVPlayerItem to stream my audio source. I would like to use audjustable but I need to be able to get my songs title.

Currently I'm using KVO on avplayeritem.timedMetadata.

How can I get the audio stream metadata in audjustable

By the way, thank for the great work !

DZamataev commented 10 years ago

+1 need this too. So much!

DZamataev commented 10 years ago

code snippet mentioned by @Tommecpe which is useful to read metadata with AVPlayer may look like this

AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:streamUrl];
[playerItem addObserver:self forKeyPath:@"timedMetadata" options:NSKeyValueObservingOptionNew context:nil];
AVPlayer* player = [AVPlayer playerWithPlayerItem:playerItem] ;
[player play];
- (void) observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object
                        change:(NSDictionary*)change context:(void*)context {

   if ([keyPath isEqualToString:@"timedMetadata"])
   {
      AVPlayerItem* playerItem = object;

      for (AVMetadataItem* metadata in playerItem.timedMetadata)
      {
         NSLog(@"\nkey: %@\nkeySpace: %@\ncommonKey: %@\nvalue: %@", [metadata.key description], metadata.keySpace, metadata.commonKey, metadata.stringValue);
      }
   }
}

is there something like this in audjustable AudioPlayer or HttpDataSource? My best option is to be notified via delegate.

tumtumtum commented 10 years ago

What type of metadata are you trying to get? Track name...ID3 tags etc?

DZamataev commented 10 years ago

Yes, track name is most needed.

02 ôåâð. 2014 ã., â 23:54, Thong Nguyen notifications@github.com íàïèñàë(à):

What type of metadata are you trying to get? Track name...ID3 tags etc?

— Reply to this email directly or view it on GitHub.

DZamataev commented 10 years ago

@tumtumtum could you please comment on this.

tumtumtum commented 10 years ago

It's not supported at the moment. Pull requests are welcome.

muthuka commented 10 years ago

+1 need this too. It will be awesome to use it with metadata.

sandeepo2o commented 5 years ago

Any update on ID3 MetaData?