Re: How can I stop a sound?
Re: How can I stop a sound?
- Subject: Re: How can I stop a sound?
- From: William Stewart <email@hidden>
- Date: Tue, 27 Jul 2004 16:01:43 -0700
You can't stop an AU like this... you have to provide valid buffers or
return an err.
You should provide buffers of silence (and set the render flag to
indicate silence)
You stop by stopping the AU (OutputUnit) that is asking the 3DMixer to
produce data
Bill
On 27/07/2004, at 2:15 PM, Francois Hamel wrote:
>
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.
>
>
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement [GSV]
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
________________________________________________________________________
__
_______________________________________________
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.