Direct Sound Is a pain in the BUTT!!!
All I have left to do is put DirectSound in my game, and IT IS SO HARD!! Does anyone else feel this way?
Do ya''ll know of any really easy to understand tutorials for it?? All the stuff I have makes me draw a blank... HELP!!
The Shaz
"I don''t want to be a pie... I don''t like gravy." - Babbs, Chicken Run
SuperNova Games
Optimism is not a state of mind, but a form of life!SuperNova Games
I was able to get a working class up from SDK docs and Lamothes wave loader.
InFerN0
Not all who wander are lost...
InFerN0
Not all who wander are lost...
InFerN0Not all who wander are lost...
i don''t know what''s so hard with it...
check it out for basic stuff...
http://qsoft.ragestorm.com/tutors/directx/letsrock.html
check it out for basic stuff...
http://qsoft.ragestorm.com/tutors/directx/letsrock.html
Sorry... I mis-posted. WAVE LOADING is a pain in the butt. I''m having trouble with it. I really would like to understand what I''m supposed to be doing. Anyone got a quick little explanation, with, maybe some example functions?
The Shaz
"I don''t want to be a pie... I don''t like gravy." - Babbs, Chicken Run
SuperNova Games
The Shaz
"I don''t want to be a pie... I don''t like gravy." - Babbs, Chicken Run
SuperNova Games
Optimism is not a state of mind, but a form of life!SuperNova Games
Well.. from the DX8 examples, I was able to get DirectSound working with little fuss, although the wave loading did throw me a bit.
But I found the solution to all my problems.. loads sounds.. plays sounds.. loads mods.. plays mods.. and it is SO easy to use...
go to FMOD
Although u do pay if you wanna use it commercially - but its a once off payment for each product .. not a % revenue deal.
regards,
GeniX
www.cryo-genix.net
But I found the solution to all my problems.. loads sounds.. plays sounds.. loads mods.. plays mods.. and it is SO easy to use...
go to FMOD
Although u do pay if you wanna use it commercially - but its a once off payment for each product .. not a % revenue deal.
regards,
GeniX
www.cryo-genix.net
regards,GeniXwww.cryo-genix.net
I agree, wave loading is a real pain in the butt.
But it''s not that difficult once you have the Windoze SDK and someone else''s code to base yours on.
Basically to procedure is as follows:
sorry it''s a bit vague, it''s been a while since I wrote my wave audio library)
1) Open the file with the multimedia i/o functions
2) Use the decending chunk functions to check it''s a RIFF file
3) Decend into the file''s WAVE child-chunk
4) Grab the audio format
5) Decend into the WAVE chunk''s DATA chunk
6) Create the DSound buffer with a format matching the wave file data which you saved earlier)
7) Lock the buffer and read the data into it.
8) Play the buffer!
Don''t take that as gospel though, I''m at work and so don''t have my code to refer from.
Waassaap!!
But it''s not that difficult once you have the Windoze SDK and someone else''s code to base yours on.
Basically to procedure is as follows:
sorry it''s a bit vague, it''s been a while since I wrote my wave audio library)
1) Open the file with the multimedia i/o functions
2) Use the decending chunk functions to check it''s a RIFF file
3) Decend into the file''s WAVE child-chunk
4) Grab the audio format
5) Decend into the WAVE chunk''s DATA chunk
6) Create the DSound buffer with a format matching the wave file data which you saved earlier)
7) Lock the buffer and read the data into it.
8) Play the buffer!
Don''t take that as gospel though, I''m at work and so don''t have my code to refer from.
Waassaap!!
Waassaap!!
Have you considered using another SDK ?
QMDX from Qsound is an excellent library, that can handle file loading, wave streaming, callback functions and other funky stuff......
It can be found at http://www.qsound.com/gamedev/
Personally I wouldn''t like to touch DirectSound with a ten foot barge pole.
Game production:
Good, quick, cheap: Choose two.
QMDX from Qsound is an excellent library, that can handle file loading, wave streaming, callback functions and other funky stuff......
It can be found at http://www.qsound.com/gamedev/
Personally I wouldn''t like to touch DirectSound with a ten foot barge pole.
Game production:
Good, quick, cheap: Choose two.
Game production:Good, quick, cheap: Choose two.
There''s nothing hard about the WAVE format. Here''s the header for a .WAV file:
typedef struct
{
char RiffSig[4];
long WaveformChunkSize;
char WaveSig[4];
char FormatSig[4];
long FormatChunkSize;
short FormatTag;
short Channels;
long SampleRate;
long BytesPerSec;
short BlockAlign;
short BitsPerSample;
char DataSig[4];
long DataSize;
} sWaveHeader;
(sorry if I don''t use Windows data types like DWORD)!
To parse a wave file, try something like the following:
FILE *fp;
char *Buf;
sWaveHeader Hdr;
fp=fopen("file.wav", "rb");
fread(&Hdr, 1, sizeof(sWaveHeader), fp);
// Make sure the sigs match here - watch case
// RiffSig = RIFF
// WaveSig = WAVE
// FormatSig = fmt~ (~ is a space)
// DataSig = data
//
// Now DataSize holds the size of the waveform data
Buf = new char[Hdr.DataSize];
fread(Buf, 1, Hdr.DataSize, fp);
fclose(fp);
// Play the sound from the buffer now
// delete buffer when done
delete Buf;
Jim Adams
Author - Programming Roleplaying Games with DirectX
typedef struct
{
char RiffSig[4];
long WaveformChunkSize;
char WaveSig[4];
char FormatSig[4];
long FormatChunkSize;
short FormatTag;
short Channels;
long SampleRate;
long BytesPerSec;
short BlockAlign;
short BitsPerSample;
char DataSig[4];
long DataSize;
} sWaveHeader;
(sorry if I don''t use Windows data types like DWORD)!
To parse a wave file, try something like the following:
FILE *fp;
char *Buf;
sWaveHeader Hdr;
fp=fopen("file.wav", "rb");
fread(&Hdr, 1, sizeof(sWaveHeader), fp);
// Make sure the sigs match here - watch case
// RiffSig = RIFF
// WaveSig = WAVE
// FormatSig = fmt~ (~ is a space)
// DataSig = data
//
// Now DataSize holds the size of the waveform data
Buf = new char[Hdr.DataSize];
fread(Buf, 1, Hdr.DataSize, fp);
fclose(fp);
// Play the sound from the buffer now
// delete buffer when done
delete Buf;
Jim Adams
Author - Programming Roleplaying Games with DirectX
Jim Adams, Author"Programming Role-Playing Games with DirectX""Advanced Animation with DirectX""Programming Role-Playing Games with DirectX, 2nd Edition"
Thanx guys... I got it running, but I''m still working through the functions in the MSDN library to figure out exactly whats going on. I appreciate your help!
The Shaz
The Shaz
Optimism is not a state of mind, but a form of life!SuperNova Games
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement