Adding Sound


Steve-O

Well-Known Member
Joined
Aug 28, 2003
Messages
4,054
Whats the command to add a sound?

Eg Im wanting a tyre skidding sound to play when a car turns :)
 
First you need a global variable, maybe call it skidding_wav.

Then you need to load the wav you want:

skidding_wav=load_wav("skidding.wav");

for example.

to play the loaded wav, put this when you want to play the wav:

play_wav(skidding_wav,0);

The 0 is the loop, 0=playing it once, 1=reapet once, 2=repeat twice,... and -1=infinite loop.

:)
 
cool, so how do I assign it to say when I click Left or right :)


Thanks
 
if(key(_left))play_wav(skidding_wav,0);end;

sorry there was an error, it has to be a "_" not a "." (the name of the variable, not the name of the file)
 
ok I found a Wav Compressor that got a Wav down from 12mb to 1.1mb BUT when I start my game, the sound is playing like its in Fast Motion... Is it possible to slow it down? the Sound works fine in Windows media player :(
 
Oh yea :p forgot about that... :D

Sam, did you get my PM about testing your game out?? :D

Im guessing this is the Code to set it to 30fps ? -

Code:
SET_FPS(0,30);

Where do I put that?? as I have tried everywhere in my source code and it doesnt change the sound speed :( Also tried lower values like 1, 2, 3, 4, 5 etc etc

Thanks
 
Not quite:

the first digit is the framerate, the second is the frameskip, so you would have a game with 0 frames per second and a frameskip of 30! :lol:

You put that right at the beginning after you set the mode (16/8 bit) and the resulotion.


You could try making the wave slower with the windows audiorecorder, but that would result in a bigger wave then. I think that is what this compressor does: it some highers the speed of the wave to get a smaller file.

Don`t think lowering the framerate is a good way either, just try to find other musics (mod/xm/it...) Try here!
 
LOL :p no wounder it didnt work :D

I wil play with the compression, just it works perfect on in windows media player
 
ok, Worked out what happened.. The Audio has to be either -

11025 Hz or 22050 Hz

:D
 
hhmmm strange... when running the Source through the PC, The sound plays perfectly but when trying it on the GP32, it runs but the Sound wont play :(
 
Thats quite normal the PC Fenic version has more function than the gp32 version, besides that, your PC should be more powerful than the gp32.
 
yea thats what I was thinking, 1.6GHZ and 512MB DDR Ram Vs 133mhz and 8mb ram... big difference :(

The Audio was just one of the Original GTA Tracks :), its still playable in Windows Media player if you want to listen to it :D
 
hehe Same, got them all :D

So, Do the sounds get loaded into the GP32's Memory or are they read off the memory card?
 
Back
Top