You're looking for a Demo in the JEDI-SDL 1.0 BETA release. it's located under the path JEDI-SDLv1.0\SDL_Mixer\Demos\WavTest There, albeit sort of hidden.

[size=9px]Psst... Dom, you you need someone to make FPC/Lazarus demos for ya? These are kind of useless to a non-Delphi guy. [/size]


--- Please note that this demo is not very straightforward and could probably be vastly improved. ---


Since you are not using Delphi (or Kylix) you will not be able to just run and test it. So open up the Main.pas file and you'll see all the code you'll need.

Considering that this code is pretty poor to make reference to I'll just cut out all the junk and post what you'll need from it. But don't let that stop you from actually going to check out the demo it's self!

Don't forget to add the DLLs to the game folder!

[pascal]uses
sdl,
sdl_mixer;

// initialization
var
audio_rate: integer;
audio_format: Uint16;
audio_channels: integer;
audio_buffers : integer;
loops: integer;

loops := 0;
if ((SDL_Init(SDL_INIT_AUDIO) < 0)) then
begin
// Could not initialize SDL Audio
SDL_Quit;
exit;
end
else
begin
audio_rate := StrToInt(seAudioRate.Text);
audio_format := StrToInt(seAudioFormat.Text);
audio_channels := StrToInt(seAudioChannels.Text);
audio_buffers := StrToInt(seAudioBuffers.Text);
// Open the audio device
if ( Mix_OpenAudio( audio_rate, audio_format, audio_channels, audio_buffers ) <0> 1) then
// Memo.Lines.Add(Format('Opened audio at %d Hz %d bit %s', [audio_rate, (audio_format and $FF), 'stereo']))
else
// Memo.Lines.Add(Format('Opened audio at %d Hz %d bit %s', [audio_rate, (audio_format and $FF), 'mono']));


// Load the requested wave file * /
wave := Mix_LoadWAV(PChar(Edit1.Text)); // Edit1.Text is the WAV file path string
if (wave = nil) then
exit;

// Play and then exit * /
Mix_PlayChannel(0, wave, loops);
while ( Mix_Playing(0) = 0 ) do
SDL_Delay(100);
end;

// now we closing everything

if ( wave <> nil ) then
begin
Mix_FreeChunk(wave);
wave := nil;
end;
if ( bAudioOpen ) then // bAudioOpen is just some flag that was used to keep track if the audio device was opened.
begin
Mix_CloseAudio;
end;
SDL_Quit;

// Done![/pascal]

If you want more in depth information about all the other functions: Read