|
Adding Sound (Motor Sound)
#262294
04/23/09 01:18
04/23/09 01:18
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Hiya, I've been working on my model for a while now, and it goes pretty good, but it does miss some stuff! One of them is the sound (Motor / Machine sound)! How can I add a sound when I let something rotate / move, the sound goes up / higher (Like a car does^^) ? This is 100% C-Script, it might be simple, so just think of a car that goes faster and faster, it sound changes, how to do it? Thanks in advance!
A7 7.77
|
|
|
Re: Adding Sound (Motor Sound)
[Re: Dreher]
#262304
04/23/09 03:05
04/23/09 03:05
|
Joined: Jul 2008
Posts: 553 Singapore
delinkx
User
|
User
Joined: Jul 2008
Posts: 553
Singapore
|
ok. i give u the pseudocode, maybe u can make the c-script urself. (cause am using lite-c) in the car action, u need to check for the events e.g.
action car()
{
if(rotate)
play skidding sound
if(speed <10)
play sound at low volume
if(speed <20 && speed > 10)
play at an increasing volume
...
...
}
this is the logic. u can convert it to c-script. let me know if there is any issues.
|
|
|
Re: Adding Sound (Motor Sound)
[Re: Dreher]
#262344
04/23/09 07:36
04/23/09 07:36
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
You can tune the sound in runtime via "snd_tune". So you can achieve seamless pitch / volume blending.
Pseudocode:
var vSoundhandle; var vVolume; var vFreq; vSoundhandle = snd_loop(sndEngine, 100, 0); while(vEngineRunning) { vVolume = vCarSpeed*vVolumeFactor; vFreq = vCarSpeed*vFreqFactor; snd_tune(vSoundhandle, vVolume, vFreq, 0); wait(1); }
no science involved
|
|
|
Re: Adding Sound (Motor Sound)
[Re: fogman]
#262366
04/23/09 11:12
04/23/09 11:12
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Ok thanks, I'm not sure yet but I will try it out and see if I can get it to work.
I've got an avi / mp3, how long should the sound sample be?
like 5 seconds or 1 second.. ? :P
A7 7.77
|
|
|
Re: Adding Sound (Motor Sound)
[Re: delinkx]
#262370
04/23/09 11:33
04/23/09 11:33
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Problem is, I've got a mp3 of 4 minutes long, I need to cut some part out, so that will be hard 'playing around' ^^
haha
A7 7.77
|
|
|
Re: Adding Sound (Motor Sound)
[Re: Dreher]
#262377
04/23/09 11:59
04/23/09 11:59
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
YouŽll need a short (~ 1 second), looped engine sound. Take a look at your GS folder: projects --> carlevel --> engine.wav to get an example. IŽll upload some sounds, just wait a minute. Edit: Here you go: http://www.vulkanware.de/stuff/enginesounds.zipEdit2: They are already looped - but you can change the charactaristics with Audacity if you want to.
Last edited by fogman; 04/23/09 12:07.
no science involved
|
|
|
Re: Adding Sound (Motor Sound)
[Re: fogman]
#262379
04/23/09 12:02
04/23/09 12:02
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Well thanks, thats a start, could you also tell me how to load in a sound, I am fairly new to 3DGS and scripting, so I've no experience with sound / adding sound!
Thanks in advance ^
A7 7.77
|
|
|
Re: Adding Sound (Motor Sound)
[Re: delinkx]
#262384
04/23/09 12:14
04/23/09 12:14
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Oki, I might need help setting it all up, but I'm already working on some small loops perfect fitting loops of lets say, 1 second. I will see the samples coming! Ok thanks for the upload, I have to go soon for a short period of time, and whenever I'm back I will take a closer look at it, and see if I can figure it all out by myself, if not, I will let you guys know! See you later.
Last edited by Dreher; 04/23/09 12:24.
A7 7.77
|
|
|
|