• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Applying AVAudioMix to an AVPlayerItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: [a little OT] File format for a bunch of floats (From: William Stewart <email@hidden>)

  • Prev by Date: Re: [a little OT] File format for a bunch of floats
  • Next by Date: Percussive attack on iPhone 4
  • Previous by thread: Re: [a little OT] File format for a bunch of floats
  • Next by thread: Re: [a little OT] File format for a bunch of floats
  • Index(es):
    • Date
    • Thread