• 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
How can I stop a sound?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I stop a sound?


  • Subject: How can I stop a sound?
  • From: Francois Hamel <email@hidden>
  • Date: Tue, 27 Jul 2004 17:15:44 -0400

Hi,

I know this may sound a little silly but I'm kinda new with CoreAudio
and I'm having problems trying to use the 3DMixer.

In my RenderCallback I did the same thing they did in the sample which
is setting the AudioBuffers to NULL like:

else
{
// there aren't any more packets to read.
// Set the amount of data read (mDataByteSize) to zero
// and return noErr to signal the AudioConverter there are
// no packets left.

ioData->mBuffers[0].mData = NULL;
ioData->mBuffers[0].mDataByteSize = 0;
gIsPlaying=FALSE;
err = noErr;
}

this is taken directly from the sample (PlayAudioFileLite). The program
does work when executed normally but in debug mode it produces an
access violation a little after having stopped on a breakpoint in this
"else" block. This is probably related to the fact that the program
sleeps a little and re-check the variable "gIsPlaying" in a loop and
maybe when run normally, the renderer never gets to use the AudioBuffer
data before time runs out?

Anyway, all I want to know is how can I stop a sound from playing ? Do
I need to fill my buffer with silence and always provide a valid audio
buffer at all time for each Input Bus of the 3DMixer?

I got another question also, do I need to setup one RenderCallback for
each Input Bus of the 3D Mixer Unit or just 1 for the whole unit? The
only 3D Mixer "tutorial" I could find didn't have the information
related to actually playing a sound (Technical Note TN2112: Using the
3DMixer Audio Unit)

thanks a lot,

Frank
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: How can I stop a sound?
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: kAudioUnitProperty_ContextName
  • Next by Date: Re: kAudioUnitProperty_ContextName
  • Previous by thread: AU Source Code
  • Next by thread: Re: How can I stop a sound?
  • Index(es):
    • Date
    • Thread