Applying AVAudioMix to an AVPlayerItem
Applying AVAudioMix to an AVPlayerItem
- Subject: Applying AVAudioMix to an AVPlayerItem
- From: McD <email@hidden>
- Date: Wed, 22 Sep 2010 10:22:31 -0700 (PDT)
Hello Core Audio Mailing List, I am attempting to apply an AVAudioMix to an AVPlayerItem , but the AudioMix doesn't seem to always get when the track is played. Sometimes it does. Sometimes it doesn't. I'm not sure if
I'm doing something incorrectly in applying the audiomix, or if I need to clear the buffers
before adding the mix or ask for a parameter from the player/asset to
make sure the audiomix is ready or what. I am sure that the AVAudioMix input parameters I am sending are correct. Any insight is appreciated.
Below is the code:
-------------------------------------
playerItem = [AVPlayerItem playerItemWithAsset:myAsset]; AVPlayer *player = [[AVPlayer alloc] initWithPlayerItem:playerItem]; self.audioPlayer = player; ... ... ... playerItem = [audioPlayer currentItem]; AVAsset *asset = [playerItem asset]; NSArray *assetTracks = [asset tracks]; AVMutableAudioMix *flatMix = [AVMutableAudioMix audioMix]; AVMutableAudioMixInputParameters *flatInputParameters = [AVMutableAudioMixInputParameters audioMixInputParametersWithTrack:[assetTracks objectAtIndex:0]]; [flatInputParameters setVolume:newVolume atTime:CMTimeMake((int)((timeVal)*100),
100)]; [flatMix setInputParameters:[NSArray arrayWithObject:flatInputParameters]]; [playerItem setAudioMix:flatMix]; [audioPlayer play]; -----------------------------------
Thanks for the help.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden