Audio port question

I have managed to somewhat port SDL audio to Macintosh

Yay! :slight_smile:

but I have run into a strange problem. When I mix reportedly UInt8 audio
as SInt8 audio, all is fine, but as soon as the converter is created for
doing the UInt8 to SInt8 conversion, it is all messed up (sound clarity
drops dramatically). Hmm, maybe SInt8 audio is trying to pass itself off
as UInt8 audio…

Maybe. The sound problem you are reporting sounds very much like what
happens when the sign bit is set incorrectly on 8-bit audio data.

BTW, the 16 bit signed little endian audio plays back fine (for example the
file included in the test directory).

Great! What kind of Mac do you have?
Can you send code? :slight_smile:

Thanks!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

I have managed to somewhat port SDL audio to Macintosh but I have run into a
strange problem. When I mix reportedly UInt8 audio as SInt8 audio, all is
fine, but as soon as the converter is created for doing the UInt8 to SInt8
conversion, it is all messed up (sound clarity drops dramatically). Hmm,
maybe SInt8 audio is trying to pass itself off as UInt8 audio…

BTW, the 16 bit signed little endian audio plays back fine (for example the
file included in the test directory).

I will send the code soon. I want to do a little more testing (I have not
tested on 44.1khz or stereo samples yet).> From: Sam Lantinga

Reply-To: sdl at lokigames.com
Date: Sun, 30 Jan 2000 15:23:54 -0800
To: sdl at lokigames.com
Subject: Re: [SDL] Audio port question

I have managed to somewhat port SDL audio to Macintosh

Yay! :slight_smile:

but I have run into a strange problem. When I mix reportedly UInt8 audio
as SInt8 audio, all is fine, but as soon as the converter is created for
doing the UInt8 to SInt8 conversion, it is all messed up (sound clarity
drops dramatically). Hmm, maybe SInt8 audio is trying to pass itself off
as UInt8 audio…

Maybe. The sound problem you are reporting sounds very much like what
happens when the sign bit is set incorrectly on 8-bit audio data.

I looked at the WAVE loading code and noticed that it always sets
spec->format = UInt8 (line 502). It seems to be reading it as SInt8 however.

BTW, the 16 bit signed little endian audio plays back fine (for example the
file included in the test directory).

Great! What kind of Mac do you have?
Can you send code? :slight_smile:

Its a G3 233 but this code will work on any machine (68k/PPC) with
SoundManager installed. It needs some mods for 68k though. It uses the
low-level SndPlayDoubleBuffer() procedure to emulate a driver, which I think
is present in SoundManager 2.0 and later (so really old machines can use
this code too). Actually it was pretty easy to implement.

I have a burning question, where is SDL_mixer.h? I am looking at some sound
code here and I see #include <SDL/SDL_mixer.h> along with various constructs
that are not a part of version 1.1 (1-28-00).

I will send the code soon. I want to do a little more testing (I have not
tested on 44.1khz or stereo samples yet).

Cool, thanks! :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Hi Darrell,

Its a G3 233 but this code will work on any machine (68k/PPC) with
SoundManager installed. It needs some mods for 68k though. It uses the
low-level SndPlayDoubleBuffer() procedure to emulate a driver, which I think
is present in SoundManager 2.0 and later (so really old machines can use
this code too). Actually it was pretty easy to implement.

Great work!
I’m looking forward to SDL fully supporting MacOS! :slight_smile:

I have a burning question, where is SDL_mixer.h? I am looking at some sound
code here and I see #include <SDL/SDL_mixer.h> along with various constructs
that are not a part of version 1.1 (1-28-00).

SDL_mixer is a separate library not included in standard SDL.
Look at “http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/index.html”!

Best regards,
Holger–
Holger.Schemel at mediaWays.net ++49 +5241 80-1438