Re: remoteIO - play audio file intermittently
Re: remoteIO - play audio file intermittently
- Subject: Re: remoteIO - play audio file intermittently
- From: Ash Gibson <email@hidden>
- Date: Tue, 05 Jun 2012 09:03:18 +1000
Thanks for the reply Aran.
I forgot to mention that this is for iOS so I don't think I have access to AUSampler or AUFilePlayer.
I can see in the mixerhost example how to push an audio file into memory and read it out during a callback. I'll it a go and see if I can get the silence happening by memset'ing the buffers to 0.
On 5 June 2012 08:33, Aran Mulholland
<email@hidden> wrote:
If you know all sounds you wish to play before hand I would use the
AUSampler. this way you can set up a patch with all of your sounds and
trigger them using core midi when they need to be played. The sounds
still run through the AUGraph so you can have sample level access but
you don't need to worry about reading files, or filling buffers in
callbacks. You could also use AUFilePlayer which has the same
advantages.
But to answer your question
just fill the buffer with 0's when you don't want any sound. (use memset)
Aran
On Tue, Jun 5, 2012 at 7:43 AM, Ash Gibson - Smartface
<
email@hidden> wrote:
> Hi everyone,
>
> Using AudioServicesPlaySystemSound I can fire off sounds from short audio
> files as needed. What I am hoping to do is the same functionality except
> using audio units.
>
> I have setup a remoteIO
> like
http://atastypixel.com/blog/using-remoteio-audio-unit/ with recording
> and playback callbacks. I have also worked through the MixerHost sample app
> so I can see how to load audio files into memory. What I am not sure of is
> how to push these files in as needed, and produce silence when needed.
>
> For example on the MixerHost app there is the following line which makes the
> audio file loop:
>
> if (sampleNumber >= frameTotalForSound) sampleNumber = 0;
>
> What if I didn't want to loop and instead wanted silence after the first
> loop?
>
> Thanks,
>
> Ash
>
> _______________________________________________
> 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
>
--
Ash Gibson
0410 329 355
www.smartface.com.au
_______________________________________________
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