• 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
The Audio Units Sample Code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The Audio Units Sample Code


  • Subject: The Audio Units Sample Code
  • From: Brian Barnes <email@hidden>
  • Date: Tue, 2 Oct 2001 23:48:03 -0400

In my iDisk:

http://homepage.mac.com/ggadwa
CoreAudioTest.sit

It's a PB project (the 10.1 version). It plays 3 samples, one looping centered, a one-shot far left and a one-shot far right. The API is:

snd_start_sample_list() // setup the list of samples
sample=snd_load_sample(char *name) // loads in an AIFF file, returns an index
snd_close_sample(int index) closes the sample

snd_start_channel_list() // prepares audio units for playing
snd_end_channel_list() // closes down audio units

id=snd_play(int sample_idx,float lft_vol,float rgt_vol,Boolean loop) // starts playing a sample returns a id
snd_stop(int id) // stops playing that sound
snd_alter(int id,float lft_vol,float rgt_vol) // alters volume of sound playing

See the function at the top of main.c to see how these are called.

Bill, I took your suggestion and moved to a single mixer unit + an output unit. I haven't hooked up the reverb unit, I have figured that out yet. Any help would be appreciated! Hopefully this code will be good enough to get others started up (and not bad enough to screw them up!)

[>] Brian


References: 
 >Re: Stopping a Audio Unit From Callback PROPERLY (From: Bill Stewart <email@hidden>)

  • Prev by Date: Re: Location of IOAudioDevice.h and other I/O Kit Headers
  • Next by Date: A note about my sample code
  • Previous by thread: Re: Stopping a Audio Unit From Callback PROPERLY
  • Next by thread: Linking together audio units
  • Index(es):
    • Date
    • Thread