More stupid audio questions

Things are now compiling under VC6 on Win95…

I was able to play a WAV file using the “playwave” sample. I then went on to
the “playmus” sample. This is were I am probably under a bunch of false
assumptions…

I plugged an audio CD into my CD player on Win95 and picked a nice
"track01.cda" file to play. The CD looks reasonable in that all the "files"
have a type of RIFF/CDDA. This type does not seem to be supported by the
library. The library is looking for RIFF/WAVE files only.

Is the operating system doing something strange, like making the audio
tracks look like files, but with the wrong headers? Is the library not
capable of dealing with audio CD’s? What’s up?

PS: My next question after this was going to be about MP3’s :-)> -----Original Message-----

From: Sam Lantinga [SMTP:slouken at devolution.com]
Sent: Thursday, February 03, 2000 11:03 PM
To: sdl at lokigames.com
Subject: Re: [SDL] Pre-release libraries

I grabbed the distributions pointed to and did not find any VisualC.zip
or
DSP files for the SDL_mixer package. The SDL_image one looked OK.

Heh, sorry. That’s added, along with some interesting patches from
Markus:
http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/src/SDL_mixer-1.
0.4.tar.gz

I have to admit… I am pretty confused about what audio functionality
is
provided by the “basic” SDL package and what SDL_mixer is adding in. I
am
imagining that SDL_mixer simply adds more audio formats in some way. Is
that
a correct assessment?

In some way.
The basic SDL audio package provides you with a callback that is passed
a buffer that you can fill with audio data that is sent to the sound card.

The SDL mixer library works at a higher level in “sounds” and "channels"
and “music”. You can load a sound and play it, load music and play it,
change volume of logical audio streams, etc.

It’s like the difference between a canvas and a painting. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

I plugged an audio CD into my CD player on Win95 and picked a nice
"track01.cda" file to play. The CD looks reasonable in that all the "files"
have a type of RIFF/CDDA. This type does not seem to be supported by the
library. The library is looking for RIFF/WAVE files only.

That’s correct. SDL does provide playing audio tracks directly (SDL_cdrom.h)
but the music library doesn’t read tracks from files and play them. It might
be a nice music module, hint hint. :slight_smile:

PS: My next question after this was going to be about MP3’s :slight_smile:

You’ll need to port the SMPEG library to Win32:
http://www.lokigames.com/development/smpeg.php3

See ya!
-Sam Lantinga (slouken at devolution.com)

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

it to were if you try and view the cd you get a directory listing with cda’s of
the tracks but they can not be read directly. Most programs that play cd’s dont
read the data from the cd they simply send a command to the cd-rom drive and it
sends the music to the soundcard (via a nice little wire that i never seem to
be able to find one that fits my soundcard and cd-rom). Also RIFF/CDDA isnt the
same as RIFF/WAVE (has a wav header) and SDL probly doesnt have suport for it

                    Jess

Bill Radcliffe wrote:> Things are now compiling under VC6 on Win95…

I was able to play a WAV file using the “playwave” sample. I then went on to
the “playmus” sample. This is were I am probably under a bunch of false
assumptions…

I plugged an audio CD into my CD player on Win95 and picked a nice
"track01.cda" file to play. The CD looks reasonable in that all the "files"
have a type of RIFF/CDDA. This type does not seem to be supported by the
library. The library is looking for RIFF/WAVE files only.

Is the operating system doing something strange, like making the audio
tracks look like files, but with the wrong headers? Is the library not
capable of dealing with audio CD’s? What’s up?

PS: My next question after this was going to be about MP3’s :slight_smile:

-----Original Message-----
From: Sam Lantinga [SMTP:slouken at devolution.com]
Sent: Thursday, February 03, 2000 11:03 PM
To: sdl at lokigames.com
Subject: Re: [SDL] Pre-release libraries

I grabbed the distributions pointed to and did not find any VisualC.zip
or
DSP files for the SDL_mixer package. The SDL_image one looked OK.

Heh, sorry. That’s added, along with some interesting patches from
Markus:
http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/src/SDL_mixer-1.
0.4.tar.gz

I have to admit… I am pretty confused about what audio functionality
is
provided by the “basic” SDL package and what SDL_mixer is adding in. I
am
imagining that SDL_mixer simply adds more audio formats in some way. Is
that
a correct assessment?

In some way.
The basic SDL audio package provides you with a callback that is passed
a buffer that you can fill with audio data that is sent to the sound card.

The SDL mixer library works at a higher level in “sounds” and "channels"
and “music”. You can load a sound and play it, load music and play it,
change volume of logical audio streams, etc.

It’s like the difference between a canvas and a painting. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Ok - then how do apps like WinAmp manage to display power meters and such?
They must have access to the decoded data in order to take an FFT or
whatever and generate their displays.

I was under the false impression that SDL_mixer would provide direct access
to CDDA data. Pardon my ignorance. This is a learning experience for me.
Hopefully others on the list will benefit as well :slight_smile:

Besides MP3 (not yet supported on Win32), what is the real utility of the
integrating mikmod into SDL? What other supported formats are important to
game development? I looked at the Win32 samples and they both play WAV
files. Each sample program is different. What is the goal of doing all this?
Is it only to get MIDI support?> -----Original Message-----

From: Jess [SMTP:jessh at lbjhs.net]
Sent: Saturday, February 05, 2000 3:25 AM
To: sdl at lokigames.com
Subject: [SDL] Re: More stupid audio questions…

it to were if you try and view the cd you get a directory listing with
cda’s of
the tracks but they can not be read directly. Most programs that play cd’s
dont
read the data from the cd they simply send a command to the cd-rom drive
and it
sends the music to the soundcard (via a nice little wire that i never seem
to
be able to find one that fits my soundcard and cd-rom). Also RIFF/CDDA
isnt the
same as RIFF/WAVE (has a wav header) and SDL probly doesnt have suport for
it

                    Jess

Bill Radcliffe wrote:

Things are now compiling under VC6 on Win95…

I was able to play a WAV file using the “playwave” sample. I then went
on to
the “playmus” sample. This is were I am probably under a bunch of false
assumptions…

I plugged an audio CD into my CD player on Win95 and picked a nice
"track01.cda" file to play. The CD looks reasonable in that all the
"files"
have a type of RIFF/CDDA. This type does not seem to be supported by
the
library. The library is looking for RIFF/WAVE files only.

Is the operating system doing something strange, like making the audio
tracks look like files, but with the wrong headers? Is the library not
capable of dealing with audio CD’s? What’s up?

PS: My next question after this was going to be about MP3’s :slight_smile:

-----Original Message-----
From: Sam Lantinga [SMTP:slouken at devolution.com]
Sent: Thursday, February 03, 2000 11:03 PM
To: sdl at lokigames.com
Subject: Re: [SDL] Pre-release libraries

I grabbed the distributions pointed to and did not find any
VisualC.zip

or

DSP files for the SDL_mixer package. The SDL_image one looked OK.

Heh, sorry. That’s added, along with some interesting patches from
Markus:

http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/src/SDL_mixer-1.

0.4.tar.gz

I have to admit… I am pretty confused about what audio
functionality

is

provided by the “basic” SDL package and what SDL_mixer is adding in.
I

am

imagining that SDL_mixer simply adds more audio formats in some way.
Is

that

a correct assessment?

In some way.
The basic SDL audio package provides you with a callback that is
passed

a buffer that you can fill with audio data that is sent to the sound
card.

The SDL mixer library works at a higher level in “sounds” and
"channels"

and “music”. You can load a sound and play it, load music and play
it,

change volume of logical audio streams, etc.

It’s like the difference between a canvas and a painting. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

I guess that you have done the hard part. I’ll try to give the SMPEG library
a shot. How hard can it be - eh?

What would your strategy by for CDDA? How do you think WinAmp and other
apps do it on Win32?> -----Original Message-----

From: Sam Lantinga [SMTP:slouken at devolution.com]
Sent: Friday, February 04, 2000 4:33 PM
To: sdl at lokigames.com
Subject: Re: [SDL] More stupid audio questions…

I plugged an audio CD into my CD player on Win95 and picked a nice
"track01.cda" file to play. The CD looks reasonable in that all the
"files"
have a type of RIFF/CDDA. This type does not seem to be supported by
the
library. The library is looking for RIFF/WAVE files only.

That’s correct. SDL does provide playing audio tracks directly
(SDL_cdrom.h)
but the music library doesn’t read tracks from files and play them. It
might
be a nice music module, hint hint. :slight_smile:

PS: My next question after this was going to be about MP3’s :slight_smile:

You’ll need to port the SMPEG library to Win32:
http://www.lokigames.com/development/smpeg.php3

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Bill Radcliffe wrote:

Ok - then how do apps like WinAmp manage to display power meters and such?
They must have access to the decoded data in order to take an FFT or
whatever and generate their displays.

thats a good question, im guessing they can somehow read the audio back from
the soundcard. It is posible to read the actual cdda data from cd but it is not
as simple as reading a file from a cd and is a lot slower.

What would your strategy by for CDDA? How do you think WinAmp and other
apps do it on Win32?

for information on te cdda format the sox source would probly be helpful. as
for reading the data from the cdrom drive on linux you might want to take a
look at cdda2wav and cdparanoia(http://www.xiph.org/paranoia/). cdda2wav
actualy includes an option to play a cd by ripping the audio data and sending
it to the soundcard. i have also used cdparanoia to do this with a pipe and sox
but its slower because it aims more at retrieveing corect data than getting it
as fast as posible. the paranoia IV library which is part of the cdparanoia
project might be useful to you, it aims at being cross-platform but currently
doesnt support much more than a few unix’s.

                Jess

Besides MP3 (not yet supported on Win32), what is the real utility of the
integrating mikmod into SDL? What other supported formats are important to
game development?

.s3m, .it, .mod, etc.
Pretty much all the old Amiga tracker formats.

See ya!
-Sam Lantinga (slouken at devolution.com)

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