Re: Core Audio for a Game Engine
Re: Core Audio for a Game Engine
- Subject: Re: Core Audio for a Game Engine
- From: Howard Moon <email@hidden>
- Date: Wed, 20 Aug 2003 11:29:50 -0700
On Wednesday, August 20, 2003, at 10:20 AM, Matthew Xavier Mora wrote:
At 8:04 AM -0700 8/20/03, Howard Moon wrote:
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).
Yeah, that's why Core Audio baffles me. Pitch changes are a
fundamental
part of any game's audio system, yet there doesn't appear to be any
way to
do it in Core Audio.
Pitch changes in games are changes to settings in tone/signal
generators. You specify a pitch in the API call for generating the
note. This is VASTLY different from changing the pitch of audio that
is being fed into an effect. Pitch change is VERY difficult to
achieve, at least with any quality. Generating different tones is
easy (at least in some API's), although I daresay I have no idea how
to use CoreAudio to generate sound (aside from calculating and
outputting the sample values themselves).
That's the question that you need to ask..."how do I GENERATE
different tones, and different waveforms (sine, square, etc.)".
i don't think that is what he is looking for. In the sound manager you
could play a sound and modify the pitch of the sound on the fly by
changing the rate at which it was being played. This allowed you to
mimic an engine revving up and down by just changing the rate. What
you want to do may not be as easy to do as it was with the
SoundMananger but I think you could do it using AudioUnits.
There is AudioUnitConvertBuffer() (or something like that) which will
allow you to supply to CoreAudio a buffer to play and it will convert
it for you. In the convert proc you could lie to core audio and tell
it that you are giving it data at a different rate than what the real
audio date rate an in the process the audio will be pitch shifted.
Some enterprising developer should write a AudioUnit game engine and
game developers would beat a path to your door. :-)
Assuming that you are looping on a simple waveform, then that concept
sounds reasonable. You couldn't apply it to just any old input, such
as voice or other complex data, but it ought to work for looping data,
I guess. (Provided, of course, that that you *can* lie to CoreAudio
like that and have it do what you're describing).
-Howard
_______________________________________________
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.