• 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
Re: Core Audio for a Game Engine
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Audio for a Game Engine


  • Subject: Re: Core Audio for a Game Engine
  • From: David Duncan <email@hidden>
  • Date: Wed, 20 Aug 2003 10:18:51 -0400

On Wednesday, August 20, 2003, at 09:41 AM, Brian Greenstone wrote:

1. So, say I was 30 sound effects channels in my game engine. If I
understand things correctly then I need to create 30 separate
Mixer/Reverb/Output Units via:

That's basically what I've got in there now which seems to work and let me
play an effect. The confusing thing is that it seems I can play multiple
simultaneous effects on that same unit, but there doesn't seem to be any way
to track or modify the effects playing on the unit. Which leads me to
question #2...

You don't need 30 output/mixer units. And unless you are doing a different reverb for each sound, you don't need 30 reverb units either. You would have one output unit, one reverb unit connected to the output, and one mixer unit connected to the reverb. The mixer unit would be configured to mix n channels of audio for which you could provide your inputs on.

2. How in the world do you change the pitch and volume of a playing sound
effect? I've found nothing in any documentation or sample code about this,
and I'm totally baffled. I've seen that I can use AudioUnitGetProperty() to
get the sample rate and other info about the Unit, but modifying any of the
data and calling AudioUnitSetProperty() seems to have zero effect.

Volume is a parameter on the mixer's input side (i.e. a parameter for each element going into the mixer). Pitch is harder as I don't believe there is a built in pitch changer audio unit (and on such a unit you would just change a parameter on it and feed it's output to the mixer).

As for why your property calls aren't having effect, all I can say is to check the return value - you should be getting some error if it is rejecting your changes. And if your not getting an error, it could be an AU further upstream that is reconfiguring an internal Audio Converter (such as the Output Unit which does this for sample rate conversion if you specify a rate that the hardware doesn't support).
--
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.

David Duncan
_______________________________________________
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: Core Audio for a Game Engine
      • From: Brian Greenstone <email@hidden>
References: 
 >Core Audio for a Game Engine (From: Brian Greenstone <email@hidden>)

  • Prev by Date: Core Audio for a Game Engine
  • Next by Date: Re: Core Audio for a Game Engine
  • Previous by thread: Core Audio for a Game Engine
  • Next by thread: Re: Core Audio for a Game Engine
  • Index(es):
    • Date
    • Thread