SDL_mixer: features I miss

Hello,

SDL_mixer is meant to be a generic API to mix fx samples and music, but
there are two things in it that are missing (from my pov):

  • the ability to play fx samples at the freq of the audio device,
    whatever the fx freq is (i.e. specially when not a multiple of audio
    device freq), like playing a 15KHz sample on a 48KHz device.

  • the ability to define raw samples (i.e. not necessarily in one of
    supported sample formats, like wav, aiff, voc, etc…): it just needs a
    function where you pass a pointer to sample start, length, freq, format.

So I would like to know if anyone is interested by these features, and
if it would be ok to have it in SDL_mixer.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Hello !

YES, please ! Such additions
to SDL_mixer would be really cool :slight_smile:

CUOn Mon, 18 Jul 2005, Patrice Mandin wrote:

Hello,

SDL_mixer is meant to be a generic API to mix fx samples and music, but
there are two things in it that are missing (from my pov):

  • the ability to play fx samples at the freq of the audio device,
    whatever the fx freq is (i.e. specially when not a multiple of audio
    device freq), like playing a 15KHz sample on a 48KHz device.

  • the ability to define raw samples (i.e. not necessarily in one of
    supported sample formats, like wav, aiff, voc, etc…): it just needs a
    function where you pass a pointer to sample start, length, freq, format.

So I would like to know if anyone is interested by these features, and
if it would be ok to have it in SDL_mixer.


Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux


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

  • the ability to define raw samples (i.e. not necessarily in one of
    supported sample formats, like wav, aiff, voc, etc…): it just needs a
    function where you pass a pointer to sample start, length, freq, format.

Would Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len) be sufficient for your
needs? Maybe this could save you some work?

-Eric> From: Patrice Mandin

Le Mon, 18 Jul 2005 14:38:32 -0700
"E. Wing" a ?crit:

Would Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len) be sufficient for your
needs? Maybe this could save you some work?

This function needs the sample to be in the same format as mixer’s
device, whereas I want to load a sample which may have a different
format (and freq).–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

This function needs the sample to be in the same format as mixer’s
device, whereas I want to load a sample which may have a different
format (and freq).

Just cut-and-paste the audio converter code from Mix_LoadWAV_RW into
Mix_QuickLoad_RAW. It’s maybe 15 lines of code.

As for resampling to the audio device’s format, this is not a limitation
of SDL_mixer, rather, it’s using SDL_ConvertAudio(), which has this problem.

–ryan.

Le Tue, 19 Jul 2005 11:37:31 -0400
"Ryan C. Gordon" a ?crit:

As for resampling to the audio device’s format, this is not a
limitation of SDL_mixer, rather, it’s using SDL_ConvertAudio(), which
has this problem.

I know this limitation, but I would like to not change SDL, and hide the
conversion in SDL_mixer.

I want to hide the conversion in SDL_mixer, because this way, I can use
(if needed) a different cpu to do the task (like an audio DSP).–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Hello,

SDL_mixer is meant to be a generic API to mix fx samples and music, but
there are two things in it that are missing (from my pov):

  • the ability to play fx samples at the freq of the audio device,
    whatever the fx freq is (i.e. specially when not a multiple of audio
    device freq), like playing a 15KHz sample on a 48KHz device.
  • the ability to define raw samples (i.e. not necessarily in one of
    supported sample formats, like wav, aiff, voc, etc…): it just needs a
    function where you pass a pointer to sample start, length, freq, format.

So I would like to know if anyone is interested by these features, and
if it would be ok to have it in SDL_mixer.

Sure.
-Sam Lantinga, Software Engineer, Blizzard Entertainment