• 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
Get AUGraph to play silence
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get AUGraph to play silence


  • Subject: Get AUGraph to play silence
  • From: Michael Hanna <email@hidden>
  • Date: Tue, 12 Jun 2012 22:32:23 -0400

I can start and play a file successfully with a simple AUGraph. It wraps a "AUGraphFilePlayer" struct that makes a simple graph like:

    FileAUNode -- OutputNode

What I would like to do next is via a user event(press pause) have the AUGraph play silence, then <press play> continue the playback of the file.

So how do I go about that? Should I feed the file node AURenderCallback silence, something like

(void)MyRenderCallback(... ...  ...)
{
    if paused state
        assign 0s to buffers
    if not paused state
        do normal file rendering
}

I did try and add a render callback to the fileAUNode like this:

  AURenderCallbackStruct input;
  input.inputProc = FileRenderProc;
  input.inputProcRefCon = player_;
  CheckError(AudioUnitSetProperty
             (player_->fileAU, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &input, sizeof(input)), "AudioUnitSetProperty failed");

Which resulted in this: Error: AudioUnitSetProperty failed (-10877), not sure why.

Is there a better way to skin this cat?

I have posted my class on pastebin:

MZRGraphPlayer.h: http://pastebin.com/6K2kZtWK
MZRGraphPlayer.m: http://pastebin.com/3vzqyQbY

Any suggestions greatly appreciated.
 _______________________________________________
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: AUEffectBase GetParameter(..)
  • Next by Date: Couple of AUSampler questions:
  • Previous by thread: Re: Detecting when an audio unit is bypassed
  • Next by thread: Re: Get AUGraph to play silence
  • Index(es):
    • Date
    • Thread