On Thu, Jun 7, 2012 at 2:59 PM, Ash Gibson <
email@hidden> wrote:
> I have been able to get some sample code up and running using AUFilePlayer (
>
http://lists.apple.com/archives/coreaudio-api/2011/Nov/msg00041.html )
>
> Is it possible to setup a button which plays this sound everytime the button
> is pushed?
>
> I understand that this is what an AUSample might be better for but reading
> through the docs and the core audio book I can't my head around how to set
> this up properly. I have 2 caf files, tick.caf and tock.caf which i created
> in audacity. They are metronome sounds with the tick being the accent that
> plays on the first beat of every bar. Using an AUSampler appears to require
> a whole heap of code or external processes to take place in order to get it
> into MIDI format. Is this correct?
>
>
> On 5 June 2012 11:16, Aran Mulholland <
email@hidden> wrote:
>>
>> IOS 5 brought with it the AUFilePlayer and AUSampler
>>
>> On Tue, Jun 5, 2012 at 9:03 AM, Ash Gibson <
email@hidden> wrote:
>> > 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
>
>
>
>
> --
> Ash Gibson
> 0410 329 355
>
www.smartface.com.au