• 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
multiple ScheduledAudioFileRegions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multiple ScheduledAudioFileRegions


  • Subject: multiple ScheduledAudioFileRegions
  • From: Robert Carroll <email@hidden>
  • Date: Thu, 07 Jun 2012 14:12:13 -0400

Hi,

Is this generally true? ie. that you can set a property on an AudioUnit multiple times without it replacing itself?

In the context of an AudioGraph with a FilePlayer unit, I tried to set multiple start times for a single ScheduledFile Region but only get playback of one instance.

for (i = 0 ; i < 10 ; i ++)  {

            

            if ( i == 0 ) startTime.mSampleTime = -1;
            else startTime.mSampleTime = (22050 * i);
        result =    AudioUnitSetProperty(
                                         filePlayerUnit, 
                                         kAudioUnitProperty_ScheduleStartTimeStamp, 
                                         kAudioUnitScope_Global, 
                                         0, 
                                         &startTime, 
                                         sizeof(startTime)
                                         );

        

        if (noErr != result) {[self printErrorMessage: @"AudioUnitSetProperty[kAudioUnitProperty_ScheduleStartTimeStamp] failed" withStatus: result]; return;} 

            

        }

On Jun 7, 2012, at 6:28 AM, email@hidden wrote:

       ScheduledAudioFileRegion rgn;
       memset (&rgn.mTimeStamp, 0, sizeof(rgn.mTimeStamp));
       rgn.mTimeStamp.mFlags = kAudioTimeStampSampleTimeValid;
       rgn.mTimeStamp.mSampleTime = 0;
       rgn.mCompletionProc = NULL;
       rgn.mCompletionProcUserData = NULL;
       rgn.mAudioFile = fileID;
       rgn.mLoopCount = INT_MAX;
       rgn.mStartFrame = 0;
       rgn.mFramesToPlay = nPackets * fileAudioFormat.mFramesPerPacket;

       CheckError(AudioUnitSetProperty(fileUnit,
kAudioUnitProperty_ScheduledFileRegion,
                                       kAudioUnitScope_Global,
0,&rgn, sizeof(rgn)),

"AudioUnitSetProperty[kAudioUnitProperty_ScheduledFileRegion] for one
of the loops");

Note that, as I uncovered a couple of weeks ago, the latter use of
AudioUnitSetProperty isn't really "setting a property", at least not
in the sense that I consider a "property". You can call this several
times in sequence with different regions, and the first value doesn't
get replaced by the later. Rather than thinking of it as a property,
think of it as passing a command to the file player, telling to add
the scheduled region you're passing in to its own internal list of
scheduled regions that need to be played.

 _______________________________________________
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

  • Prev by Date: Re: AUFilePlayer kAudioUnitProperty_ScheduledFileIDs
  • Next by Date: Converting multichannel file to stereo with down-mix.
  • Previous by thread: remoteIO playback setup
  • Next by thread: Converting multichannel file to stereo with down-mix.
  • Index(es):
    • Date
    • Thread