Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Kingware, AemStones, RealSerious3D), 1,388 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Adding Sound (Motor Sound) #262294
04/23/09 01:18
04/23/09 01:18
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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? smile

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 Offline
User
delinkx  Offline
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.

Code:
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.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
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
F
fogman Offline
Expert
fogman  Offline
Expert
F

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
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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: Dreher] #262368
04/23/09 11:24
04/23/09 11:24
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
use mp3.. y use avi. mp3 gonna be smaller file. less load. ah.. if u want best results. play around with the timings. run the game, turn ur car.. play around with the values then u can find out the best sample time.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Adding Sound (Motor Sound) [Re: delinkx] #262370
04/23/09 11:33
04/23/09 11:33
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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
F
fogman Offline
Expert
fogman  Offline
Expert
F

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.zip
Edit2: 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
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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: fogman] #262382
04/23/09 12:03
04/23/09 12:03
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
use a free audio tool like audacity to cut off ur sounds into multiple small loops where u gonna use them. fogman gonna upload some for u !

cheers smile


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: Adding Sound (Motor Sound) [Re: delinkx] #262384
04/23/09 12:14
04/23/09 12:14
Joined: Apr 2009
Posts: 113
Netherlands
D
Dreher Offline OP
Warez Victim
Dreher  Offline OP
Warez Victim
D

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! wink

See you later.

Last edited by Dreher; 04/23/09 12:24.

A7 7.77
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1