SDL_Mixer and speed/pitch shift

Nobody using pitch shift here? :confused:

Cheers,–
Sylvain

On Wed, Aug 01, 2007 at 05:03:15PM +0200, Sylvain Beucler wrote:

Hi,

I’d like to use SDL_Mixer to play multiple sounds at once, and with
different speeds for each sound.

This allow, for example, to play a normal voice and an acute voice
from the same sound file, by playing it with a greater frequency for
the acute voice.

This feature (which is often refered to as “pitch shift”) seems to be
missing from SDL_Mixer.
(I don’t think I can implement it with an SDL_Mixer Effect either,
because the callback can only modify a fixed-length sample.)

Is there a way to implement pitch shift with SDL_Mixer? Or an
alternate SDL library that would do that (but I also need midi/BGM
support in the mixer)?

For example, DirectX provides it through
DirectSoundBuffer::SetFrequency(frequency), and Allegro provides it
with play_sample(sample, t vol, pan, freq, loop).

Thanks!

[…]

Well, I do (in Kobo Deluxe, which uses un unnamed predecessor to
Audiality) - but I wouldn’t really recommend using either of those
engines for anything serious at this point. They’re both effectively
dead, and I’m working on some rather different solutions to replace
them. (PicoSound for basic streaming/playback/mixing, new Audiality
based on a real time scripting engine for advanced synthesis and
ChipSound for more retro style and less CPU hungry synthesis.)

Depending on what you need though, you might be able to find some
useful code in there. Maybe ripping the resampler (voice) code, and
using SDL_sound for music?

Or, if you’re in no particular hurry, you can wait for me to get
PicoSound done. :wink:

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Monday 06 August 2007, Sylvain Beucler wrote:

Nobody using pitch shift here? :confused:

Hi,

You’re correct that SDL_mixer itself doesn’t have support for pitch-shifting
sounds. However, since it does give you direct access to the sound stream
buffer via the mixing callback functions (such as the post-mix callback),
you can implement it yourself.

My Eternity Engine Doom port has a rudimentary pitch shifting ability.
Looking at it might give you an idea on what would be involved.
Link to the file:
http://eternity.mancubus.net/svn/trunk/eternity/source/sdl/i_sound.c

EE just does all its own digital sound mixing and then pipes it through
SDL_mixer, which we use mainly for playing music. I should probably note
that our sound engine crashes on some x86 Mac machines due apparently to
some mysterious bug in SDL_mixer or its interaction with some particular
sound driver (it sends us a bad buffer seemingly at random). As of the
latest release, this is still a problem for one of my users, so watch out
for that when accessing the stream buffer directly.

Yours,
James Haley>From: Sylvain Beucler

Reply-To: “A list for developers using the SDL library. (includes
SDL-announce)”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL_Mixer and speed/pitch shift
Date: Mon, 6 Aug 2007 00:21:36 +0200
MIME-Version: 1.0
Received: from diego.dreamhost.com ([66.33.216.104]) by
bay0-mc11-f9.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sun, 5
Aug 2007 15:21:45 -0700
Received: from diego.dreamhost.com (localhost [127.0.0.1])by
diego.dreamhost.com (Postfix) with ESMTP id 4B7FF4800A;Sun, 5 Aug 2007
15:21:41 -0700 (PDT)
Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29])by
diego.dreamhost.com (Postfix) with ESMTP id 9EA8448006for
; Sun, 5 Aug 2007 15:21:38 -0700 (PDT)
Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1])by
smtp3-g19.free.fr (Postfix) with ESMTP id 11A0638F1for
; Mon, 6 Aug 2007 00:21:37 +0200 (CEST)
Received: from localhost.localdomain (unknown [82.238.35.175])by
smtp3-g19.free.fr (Postfix) with ESMTP id EC72238DFfor
; Mon, 6 Aug 2007 00:21:36 +0200 (CEST)
Received: from me by localhost.localdomain with local (Exim
4.63)(envelope-from ) id 1IHoTg-0006Zz-BDfor
sdl at lists.libsdl.org; Mon, 06 Aug 2007 00:21:36 +0200
X-Message-Delivery: Vj0zLjQuMDt1cz0wO2k9MDtsPTA7YT0w
X-Message-Info:
KYGz7ipbXiQwgYXFWQLpmdesWxUDBbFeBb6euDEH2q4rALn62YNWFanUZM/SkKpxFki9KJ2QxxqrlU/kf20YGSUnl4vVVtPD
X-Original-To: sdl at lists.libsdl.org
References: <20070801150315.GA7104 at perso.beuc.net>
X-Operating-System: GNU/Linux
User-Agent: Mutt/1.5.13 (2006-08-11)
X-BeenThere: sdl at lists.libsdl.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: “A list for developers using the SDL library.
(includesSDL-announce)” <sdl-libsdl.org>
List-Unsubscribe:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org,<mailto:sdl-request at lists.libsdl.org?subject=unsubscribe>
List-Archive: http://lists.libsdl.org/private.cgi/sdl-libsdl.org
List-Post: <mailto:sdl at lists.libsdl.org>
List-Help: <mailto:sdl-request at lists.libsdl.org?subject=help>
List-Subscribe:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org,<mailto:sdl-request at lists.libsdl.org?subject=subscribe>
Errors-To: sdl-bounces at lists.libsdl.org
Return-Path: sdl-bounces at lists.libsdl.org
X-OriginalArrivalTime: 05 Aug 2007 22:21:45.0469 (UTC)
FILETIME=[01E9B2D0:01C7D7AF]

Nobody using pitch shift here? :confused:

Cheers,

–
Sylvain

On Wed, Aug 01, 2007 at 05:03:15PM +0200, Sylvain Beucler wrote:

Hi,

I’d like to use SDL_Mixer to play multiple sounds at once, and with
different speeds for each sound.

This allow, for example, to play a normal voice and an acute voice
from the same sound file, by playing it with a greater frequency for
the acute voice.

This feature (which is often refered to as “pitch shift”) seems to be
missing from SDL_Mixer.
(I don’t think I can implement it with an SDL_Mixer Effect either,
because the callback can only modify a fixed-length sample.)

Is there a way to implement pitch shift with SDL_Mixer? Or an
alternate SDL library that would do that (but I also need midi/BGM
support in the mixer)?

For example, DirectX provides it through
DirectSoundBuffer::SetFrequency(frequency), and Allegro provides it
with play_sample(sample, t vol, pan, freq, loop).

Thanks!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


More photos, more messages, more storage?get 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507

I should probably note
that our sound engine crashes on some x86 Mac machines due apparently to
some mysterious bug in SDL_mixer or its interaction with some particular
sound driver (it sends us a bad buffer seemingly at random). As of the
latest release, this is still a problem for one of my users

Can you enter a bug in bugzilla with as much info as possible?
http://bugzilla.libsdl.org

Thanks!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

Hi,

I was thinking that was not possible; for example, if you want to play
a sound slower, it takes a bigger buffer to store it, and the callback
works with a fixed-length buffer. So at first glance I believe
SDL_Mixer will stop the pitch-shifted sound before it ends.

Do you think it is possible to bypass this limitation?

Thanks for the link.–
Sylvain

On Mon, Aug 06, 2007 at 12:27:19AM -0500, James Haley wrote:

Hi,

You’re correct that SDL_mixer itself doesn’t have support for
pitch-shifting sounds. However, since it does give you direct access to the
sound stream buffer via the mixing callback functions (such as the post-mix
callback), you can implement it yourself.

My Eternity Engine Doom port has a rudimentary pitch shifting ability.
Looking at it might give you an idea on what would be involved.
Link to the file:
http://eternity.mancubus.net/svn/trunk/eternity/source/sdl/i_sound.c

EE just does all its own digital sound mixing and then pipes it through
SDL_mixer, which we use mainly for playing music. I should probably note
that our sound engine crashes on some x86 Mac machines due apparently to
some mysterious bug in SDL_mixer or its interaction with some particular
sound driver (it sends us a bad buffer seemingly at random). As of the
latest release, this is still a problem for one of my users, so watch out
for that when accessing the stream buffer directly.

Yours,
James Haley

From: Sylvain Beucler <@Sylvain_Beucler>
Reply-To: “A list for developers using the SDL library. (includes
SDL-announce)”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL_Mixer and speed/pitch shift
Date: Mon, 6 Aug 2007 00:21:36 +0200
MIME-Version: 1.0
Received: from diego.dreamhost.com ([66.33.216.104]) by
bay0-mc11-f9.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sun,
5 Aug 2007 15:21:45 -0700
Received: from diego.dreamhost.com (localhost [127.0.0.1])by
diego.dreamhost.com (Postfix) with ESMTP id 4B7FF4800A;Sun, 5 Aug 2007
15:21:41 -0700 (PDT)
Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29])by
diego.dreamhost.com (Postfix) with ESMTP id 9EA8448006for
; Sun, 5 Aug 2007 15:21:38 -0700 (PDT)
Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1])by
smtp3-g19.free.fr (Postfix) with ESMTP id 11A0638F1for
; Mon, 6 Aug 2007 00:21:37 +0200 (CEST)
Received: from localhost.localdomain (unknown [82.238.35.175])by
smtp3-g19.free.fr (Postfix) with ESMTP id EC72238DFfor
; Mon, 6 Aug 2007 00:21:36 +0200 (CEST)
Received: from me by localhost.localdomain with local (Exim
4.63)(envelope-from <@Sylvain_Beucler>) id 1IHoTg-0006Zz-BDfor
sdl at lists.libsdl.org; Mon, 06 Aug 2007 00:21:36 +0200
X-Message-Delivery: Vj0zLjQuMDt1cz0wO2k9MDtsPTA7YT0w
X-Message-Info:
KYGz7ipbXiQwgYXFWQLpmdesWxUDBbFeBb6euDEH2q4rALn62YNWFanUZM/SkKpxFki9KJ2QxxqrlU/kf20YGSUnl4vVVtPD
X-Original-To: sdl at lists.libsdl.org
References: <20070801150315.GA7104 at perso.beuc.net>
X-Operating-System: GNU/Linux
User-Agent: Mutt/1.5.13 (2006-08-11)
X-BeenThere: sdl at lists.libsdl.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: “A list for developers using the SDL library.
(includesSDL-announce)” <sdl-libsdl.org>
List-Unsubscribe:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org,<mailto:sdl-request at lists.libsdl.org?subject=unsubscribe>
List-Archive: http://lists.libsdl.org/private.cgi/sdl-libsdl.org
List-Post: <mailto:sdl at lists.libsdl.org>
List-Help: <mailto:sdl-request at lists.libsdl.org?subject=help>
List-Subscribe:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org,<mailto:sdl-request at lists.libsdl.org?subject=subscribe>
Errors-To: sdl-bounces at lists.libsdl.org
Return-Path: sdl-bounces at lists.libsdl.org
X-OriginalArrivalTime: 05 Aug 2007 22:21:45.0469 (UTC)
FILETIME=[01E9B2D0:01C7D7AF]

Nobody using pitch shift here? :confused:

Cheers,

–
Sylvain

On Wed, Aug 01, 2007 at 05:03:15PM +0200, Sylvain Beucler wrote:

Hi,

I’d like to use SDL_Mixer to play multiple sounds at once, and with
different speeds for each sound.

This allow, for example, to play a normal voice and an acute voice
from the same sound file, by playing it with a greater frequency for
the acute voice.

This feature (which is often refered to as “pitch shift”) seems to be
missing from SDL_Mixer.
(I don’t think I can implement it with an SDL_Mixer Effect either,
because the callback can only modify a fixed-length sample.)

Is there a way to implement pitch shift with SDL_Mixer? Or an
alternate SDL library that would do that (but I also need midi/BGM
support in the mixer)?

For example, DirectX provides it through
DirectSoundBuffer::SetFrequency(frequency), and Allegro provides it
with play_sample(sample, t vol, pan, freq, loop).

Thanks!

Is there a way to implement pitch shift with SDL_Mixer? Or an
alternate SDL library that would do that (but I also need midi/BGM
support in the mixer)?

One alternative is OpenAL (+ SDL_sound to decode?). Pitch shifting is
easy in OpenAL, e.g.
alSourcef(mySource1, AL_PITCH, pitch_multiplier);

-Eric

Errata: after a little research it appears I aim at “pitch
transposition” / “sample rate conversion” (which changes the length of
the buffer) rather than actual “pitch shifting” (which does not change
the length of the buffer).

Maybe that better explains my worries about implementing it via a
SDL_Mixer callback :)–
Sylvain

On Mon, Aug 06, 2007 at 07:59:02AM +0200, Sylvain Beucler wrote:

Hi,

I was thinking that was not possible; for example, if you want to play
a sound slower, it takes a bigger buffer to store it, and the callback
works with a fixed-length buffer. So at first glance I believe
SDL_Mixer will stop the pitch-shifted sound before it ends.

Do you think it is possible to bypass this limitation?

Thanks for the link.

–
Sylvain

On Mon, Aug 06, 2007 at 12:27:19AM -0500, James Haley wrote:

Hi,

You’re correct that SDL_mixer itself doesn’t have support for
pitch-shifting sounds. However, since it does give you direct access to the
sound stream buffer via the mixing callback functions (such as the post-mix
callback), you can implement it yourself.

My Eternity Engine Doom port has a rudimentary pitch shifting ability.
Looking at it might give you an idea on what would be involved.
Link to the file:
http://eternity.mancubus.net/svn/trunk/eternity/source/sdl/i_sound.c

EE just does all its own digital sound mixing and then pipes it through
SDL_mixer, which we use mainly for playing music. I should probably note
that our sound engine crashes on some x86 Mac machines due apparently to
some mysterious bug in SDL_mixer or its interaction with some particular
sound driver (it sends us a bad buffer seemingly at random). As of the
latest release, this is still a problem for one of my users, so watch out
for that when accessing the stream buffer directly.

Yours,
James Haley

From: Sylvain Beucler <@Sylvain_Beucler>
Reply-To: “A list for developers using the SDL library. (includes
SDL-announce)”
To: sdl at lists.libsdl.org
Subject: Re: [SDL] SDL_Mixer and speed/pitch shift
Date: Mon, 6 Aug 2007 00:21:36 +0200
MIME-Version: 1.0
Received: from diego.dreamhost.com ([66.33.216.104]) by
bay0-mc11-f9.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sun,
5 Aug 2007 15:21:45 -0700
Received: from diego.dreamhost.com (localhost [127.0.0.1])by
diego.dreamhost.com (Postfix) with ESMTP id 4B7FF4800A;Sun, 5 Aug 2007
15:21:41 -0700 (PDT)
Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29])by
diego.dreamhost.com (Postfix) with ESMTP id 9EA8448006for
; Sun, 5 Aug 2007 15:21:38 -0700 (PDT)
Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1])by
smtp3-g19.free.fr (Postfix) with ESMTP id 11A0638F1for
; Mon, 6 Aug 2007 00:21:37 +0200 (CEST)
Received: from localhost.localdomain (unknown [82.238.35.175])by
smtp3-g19.free.fr (Postfix) with ESMTP id EC72238DFfor
; Mon, 6 Aug 2007 00:21:36 +0200 (CEST)
Received: from me by localhost.localdomain with local (Exim
4.63)(envelope-from <@Sylvain_Beucler>) id 1IHoTg-0006Zz-BDfor
sdl at lists.libsdl.org; Mon, 06 Aug 2007 00:21:36 +0200
X-Message-Delivery: Vj0zLjQuMDt1cz0wO2k9MDtsPTA7YT0w
X-Message-Info:
KYGz7ipbXiQwgYXFWQLpmdesWxUDBbFeBb6euDEH2q4rALn62YNWFanUZM/SkKpxFki9KJ2QxxqrlU/kf20YGSUnl4vVVtPD
X-Original-To: sdl at lists.libsdl.org
References: <20070801150315.GA7104 at perso.beuc.net>
X-Operating-System: GNU/Linux
User-Agent: Mutt/1.5.13 (2006-08-11)
X-BeenThere: sdl at lists.libsdl.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: “A list for developers using the SDL library.
(includesSDL-announce)” <sdl-libsdl.org>
List-Unsubscribe:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org,<mailto:sdl-request at lists.libsdl.org?subject=unsubscribe>
List-Archive: http://lists.libsdl.org/private.cgi/sdl-libsdl.org
List-Post: <mailto:sdl at lists.libsdl.org>
List-Help: <mailto:sdl-request at lists.libsdl.org?subject=help>
List-Subscribe:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org,<mailto:sdl-request at lists.libsdl.org?subject=subscribe>
Errors-To: sdl-bounces at lists.libsdl.org
Return-Path: sdl-bounces at lists.libsdl.org
X-OriginalArrivalTime: 05 Aug 2007 22:21:45.0469 (UTC)
FILETIME=[01E9B2D0:01C7D7AF]

Nobody using pitch shift here? :confused:

Cheers,

–
Sylvain

On Wed, Aug 01, 2007 at 05:03:15PM +0200, Sylvain Beucler wrote:

Hi,

I’d like to use SDL_Mixer to play multiple sounds at once, and with
different speeds for each sound.

This allow, for example, to play a normal voice and an acute voice
from the same sound file, by playing it with a greater frequency for
the acute voice.

This feature (which is often refered to as “pitch shift”) seems to be
missing from SDL_Mixer.
(I don’t think I can implement it with an SDL_Mixer Effect either,
because the callback can only modify a fixed-length sample.)

Is there a way to implement pitch shift with SDL_Mixer? Or an
alternate SDL library that would do that (but I also need midi/BGM
support in the mixer)?

For example, DirectX provides it through
DirectSoundBuffer::SetFrequency(frequency), and Allegro provides it
with play_sample(sample, t vol, pan, freq, loop).

Thanks!

Thanks. I had seen OpenAL, though it does not support MIDIs. Do you
know if it is possible to mix 'n match several sound libraries at once
(like alSourcef and MIX_PlayMUS in the program)?

Or maybe I should just try to implement rate conversion in
SDL_Mixer… :)On Sun, Aug 05, 2007 at 11:55:15PM -0700, E. Wing wrote:

Is there a way to implement pitch shift with SDL_Mixer? Or an
alternate SDL library that would do that (but I also need midi/BGM
support in the mixer)?

One alternative is OpenAL (+ SDL_sound to decode?). Pitch shifting is
easy in OpenAL, e.g.
alSourcef(mySource1, AL_PITCH, pitch_multiplier);

–
Sylvain

Hello !

Or maybe I should just try to implement rate conversion in
SDL_Mixer… :slight_smile:

SDL_mixer is really meant to be a simple
play music in the background
and some samples in the foreground.

It was never meant to be a Sound System.
Have you tried Ryan’s SDL Sound ?

CU

Sorry, I meant that I need the audio library to play unmodified MIDIs
as background and play WAVs at various rates (I don’t plan to apply
rate conversion on MIDIs).

I’ll see what I can do with using different libraries for those 2
tasks.On Mon, Aug 06, 2007 at 10:47:57PM +0200, Torsten Giebl wrote:

Hello !

Or maybe I should just try to implement rate conversion in
SDL_Mixer… :slight_smile:

SDL_mixer is really meant to be a simple
play music in the background
and some samples in the foreground.

It was never meant to be a Sound System.
Have you tried Ryan’s SDL Sound ?

–
Sylvain

I believe SDL_sound does the same technique of WAV conversion for MIDI
as SDL_mixer does so you could still use OpenAL.

I don’t know if using both SDL_mixer and OpenAL simultaneously is
going to work consistently across platforms. I have flashbacks to old
Win95 (and 3.1 era) where you would get 'Resource already in use’
errors. I do know that libmikmod is not reentrant and if SDL_mixer and
SDL_sound are both active and using it, you will have serious
problems.

‘Native’ MIDI is usually a different device/resource on systems, but
all SDL_mixer and SDL_sound are doing is converting them to be played
back like a WAV. I’ve always had a soft spot for MIDI, but the truth
is that MIDI is pretty much dead outside the musician realm. In my
opinion, if all you care about is background music, you’re much better
off dropping MIDI and not worrying about it. If you use MIDIs, you
will be at the mercy of the quality of samples SDL_sound and
SDL_mixer’s converters use which aren’t stellar. If there are MIDIs
you really like and want to use, you are much better off getting an
old Roland Sound Canvas or Yamaha MU (or both) and recording the song
to WAV (or MP3, Ogg, etc) and just using that and shipping the
recording ensuring everybody gets a high quality sound track. (Some
old games at the end of the MIDI era shipped both MIDI support and
recorded music. The recorded music was often a recording of the MIDI
playback on the Roland Sound Canvas SCC-1 or SC-55. Recorded music was
enabled if you kept the CD in the drive so everybody could experience
a higher quality of music and didn’t require you to own a Sound
Canvas. Warcraft 2 did it this way.)

Conversely, you could also write or find something that accesses the
MIDI device directly so MIDI gets played back on the separate/native
device. (PortMusic/PortMIDI might do this.) And FYI, native MIDI would
give you incredible control over ‘rate conversion’ as you can
dynamically change the key (e.g. octave) and tempo independently
without requiring one affecting the other. But for instrument/playback
quality, you will be at the mercy of the built in MIDI device on the
system, and a lot of them are really bad. This is why MIDI has such a
bad reputation among the mainstream.

-EricOn 8/6/07, Sylvain Beucler wrote:

On Mon, Aug 06, 2007 at 10:47:57PM +0200, Torsten Giebl wrote:

Hello !

Or maybe I should just try to implement rate conversion in
SDL_Mixer… :slight_smile:

SDL_mixer is really meant to be a simple
play music in the background
and some samples in the foreground.

It was never meant to be a Sound System.
Have you tried Ryan’s SDL Sound ?

Sorry, I meant that I need the audio library to play unmodified MIDIs
as background and play WAVs at various rates (I don’t plan to apply
rate conversion on MIDIs).

I’ll see what I can do with using different libraries for those 2
tasks.

–
Sylvain


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’m still searching for a pitch / speed option for SDL_Mixer. Are there any recent developments?

I know some of you have written your own mixers; something that’s beyond my scope of ability without investing a lot of time to understand how to do the same.

Surely, if the music part of SDL_Mixer can play samples at different pitches to produce the correct notes, can’t the same effect be applied to samples?

Hello, I have a work-in-progress code to change pitch/speed of Mix_Chunk’s that relies only on SDL_mixer. It worked for me, although it still produces some crackling artifacts. Is this helpful? (Sorry for digging up this post)

SDL_Mixer chunk pitching example gist

2 Likes

Thank you for digging this up! Excited to try this; will let you know…

No problem. I would be glad if it can be of help. Better even if someone could help to improve the code and eliminate the crackling. I think it needs a proper low pass filter, but I’m a layman on the subject.

The crackling might be an underlying problem of SDL_Mixer and the new SDL2.0.6, because many of us have been experiencing cracking without adding any effect filters

I could really really do with this functionality in SDL_Mixer too!

My iOS game “Firefight” uses OpenAL and uses alSourcef(mySource1, AL_PITCH, pitch_multiplier); to make the tank engine revving sound change pitch as it rises and falls.

The SDL port on Steam can’t do that :frowning:

I’m honestly not sure about it, because I have tested that code on many versions of SDL and SDL_mixer (including SDL 1.2) and on all of them I can hear the crackling on my test code. I believe there is a problem on my code, independently of crackling related to the newer SDL 2.0.6 version.

Hello, I tried to removed C++ technicalities from that pitch test code. Hopefully it should be easier to read (or not :stuck_out_tongue_closed_eyes: ).

Here is a C version of that pitch test code:
SDL_mixer Mix_Chunk pitching C example gist.

1 Like

Is this MIT Licensed?