Does SDL_Mixer allow frequency changes?

Hi,

I’m looking for a way to vary the frequency of an engine sound effect - to
simulate the noise of a car, revving as it speeds up/slows down.
Its possible in fmod but SDL_Mixer doesn’t seem to have any reference to
frequency other than the frequency the audio system is initialised with.

I’ve considered creating multiple copies of a sound, with different
frequencies, but that’s not dynamic and sounds horrible compared to the fmod
solution i used to use.

Has anyone out there found or created a way of dynamically changing a sound
sample frequency in SDL_Mixer?

Regards,
Damian

Hi,

I’m looking for a way to vary the frequency of an engine sound effect

  • to simulate the noise of a car, revving as it speeds up/slows down.
    Its possible in fmod but SDL_Mixer doesn’t seem to have any reference
    to frequency other than the frequency the audio system is initialised
    with.

I’ve considered creating multiple copies of a sound, with different
frequencies, but that’s not dynamic and sounds horrible compared to
the fmod solution i used to use.

Has anyone out there found or created a way of dynamically changing a
sound sample frequency in SDL_Mixer?

Don`t know if SDL_Mixer can do this, but you may have a look at OpenAL.
http://www.openal.org

Bye,
CarstenOn Thu, 28 Oct 2004 07:49:03 +0000 (UTC) Damian <damian_rajkowski at technologyonecorp.com> wrote:

@Carsten_Ziepke
Linux User: #248382
Linux Counter: http://counter.li.org

Carsten Ziepke <kieltux sendmail.ru> writes:

I’m looking for a way to vary the frequency of an engine sound effect

  • to simulate the noise of a car, revving as it speeds up/slows down.
    Its possible in fmod but SDL_Mixer doesn’t seem to have any reference
    to frequency other than the frequency the audio system is initialised
    with.

Don`t know if SDL_Mixer can do this, but you may have a look at OpenAL.
http://www.openal.org

Hi Carsten,

Thanks for the advice, but OpenAL isn’t quite suitable for me. When I looked at
it several months ago it only loaded WAV files natively, and you had to write
code to load other formats (mid/s3m/xm/it/mp3) yourself, which ain’t easy.
(If this has changed, let me know.)

Of course fmod and Bass do everything i need, but they’re licenced.

I was hoping somebody had a way of making SDL_Mixer do this, which I might have
missed. If not, i’ll just have to drop the effect and try something else.

Regards,
Damian

You could use Mix_RegisterEffect() and code your own pitch-shifter.
It’s not that tricky if you know hiow PCM works.

If you don’t, seerch google for “PCM”, “DSP” and “pitch-shift” (posiby in
combination with “C++”)
and you’re likely to find something.

/Jakob EklundOn Thu, 28 Oct 2004 22:50:39 +0000 (UTC), Damian <damian_rajkowski at technologyonecorp.com> wrote:

Carsten Ziepke <kieltux sendmail.ru> writes:

I’m looking for a way to vary the frequency of an engine sound effect

  • to simulate the noise of a car, revving as it speeds up/slows down.
    Its possible in fmod but SDL_Mixer doesn’t seem to have any reference
    to frequency other than the frequency the audio system is initialised
    with.

Don`t know if SDL_Mixer can do this, but you may have a look at OpenAL.
http://www.openal.org

Hi Carsten,

Thanks for the advice, but OpenAL isn’t quite suitable for me. When I
looked at
it several months ago it only loaded WAV files natively, and you had to
write
code to load other formats (mid/s3m/xm/it/mp3) yourself, which ain’t
easy.
(If this has changed, let me know.)

Of course fmod and Bass do everything i need, but they’re licenced.

I was hoping somebody had a way of making SDL_Mixer do this, which I
might have
missed. If not, i’ll just have to drop the effect and try something else.

Regards,
Damian


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl