Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, TedMar), 1,031 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Playing sounds problem [Re: 4gottenname] #275003
06/29/09 16:25
06/29/09 16:25
Joined: Jun 2009
Posts: 22
Finland
4gottenname Offline OP
Newbie
4gottenname  Offline OP
Newbie

Joined: Jun 2009
Posts: 22
Finland
Still need a litle bit of help.
I got a panel with 4 sliders that should control the volumes for master, sfx, music and voices. They sort of work but not exactly the way I want them to wink

hslider(381, 125, 281, volumeslider, 0, 100, master_vol);
hslider(381, 163, 281, volumeslider, 0, 100, sfx_volume);
hslider(381, 201, 281, volumeslider, 0, 100, music_volume);
hslider(381, 238, 281, volumeslider, 0, 100, voices_volume);

master_vol is predefined and works perfectly. When dragging it all the playing sound volumes gets lower or higher. Is it possible to get this effect with the 3 others, made up ones?
I have a button next to every slider that plays a sound sample when klicked. I have to klick and play the sound again after i dragged the slider to hear the changes. I want them to change while I'm dragging.
And someone please tell me what file format to use for longer music, wav gets too big :P (need to be suported)

Re: Playing sounds problem [Re: 4gottenname] #275052
06/29/09 21:54
06/29/09 21:54
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Im no biggie on sounds yet, hell, I havent even gone beyond "beep()" yet... BUT

(for EDIT1)I dont think its actually working CORRECTLY, you just got lucky.
Whenever 3DGS loads a SOUND file, it also creates a hidden SOUND structure based
on the sounds filename, with a "_" replacing the "." (ie "beep.wav" becomes beep_wav)
So your new name is just a lucky "match" to that hidden name.
More testing is required. Maybe post the code lines that actually DO the snd_play / snd_loop?

(for EDIT2) I assume you are using snd_play or snd_loop to run the sounds.
Firstly, snd_anything can ONLY play WAV or OGG files. So I suggest to hit the manual,
and read up on MEDIA_play and MEDIA_loop. They CAN handle mp3 files.
You just need to use them a LITTLE differently. (No SOUND objects)

Assuming you use media_something to play your music, you can use this panel code to control your volumes.
hslider(381, 125, 281, volumeslider, 0, 100, master_vol); <<still MASTER volume
hslider(381, 163, 281, volumeslider, 0, 100, sound_vol); <<still SFX volume
hslider(381, 201, 281, volumeslider, 0, 100, midi_vol); <<still MUSIC volume
hslider(381, 238, 281, volumeslider, 0, 100, voices_volume); <<no idea.....


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Playing sounds problem [Re: EvilSOB] #275173
06/30/09 13:11
06/30/09 13:11
Joined: Jun 2009
Posts: 22
Finland
4gottenname Offline OP
Newbie
4gottenname  Offline OP
Newbie

Joined: Jun 2009
Posts: 22
Finland
In one of my previous post i said
"I have defined SOUND* testwav = "mouseover.wav"; and call a function with snd_play(testwav,100,0); in it".
Later when I changed both the testwav names to mouseover it started working. The strange thing was that the SOUND* testwav = "mouseover.wav"; line caused my panel to not show so I never even got to klick the button that should have played the wav...
But now it works and I'm happy.

Yesterday I tried media_play with a mp3 and got a "mp3 unsuported format" so thougt I couldn't use them with free version. same with an other format. Tried again today after reading your post and it works fine so either the mp3 was bad or I must have screwd it up and used snd_play or something after all.
I do read the manual before I post, I just don't get it all wink They so need to add more explanations and examples.

This is the problem with sound_vol: "It does not affect the volume of still playing sounds that were started before" and I asumed the same was for midi_vol but that one actually work.
Any ideas on how to make the sfx and voices volume change while playing the sounds? Can't be impossible... Not that important for my project (they only set the volume value for the sounds later on in the game) but it bothers me. I bet others have needed something like this before.
Plan B would be to make the sound stop when slider gets dragged and automaticaly play again when slider stands still / left mouse button released...

Page 2 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