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
3 registered members (ozgur, degenerate_762, 7th_zorro), 1,081 guests, and 0 spiders.
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 1 of 2 1 2
Playing sounds problem #274836
06/28/09 19:59
06/28/09 19:59
Joined: Jun 2009
Posts: 22
Finland
4gottenname Offline OP
Newbie
4gottenname  Offline OP
Newbie

Joined: Jun 2009
Posts: 22
Finland
I ran in to an annoying litle problem again and been searching for an anwser for hours. This time I can't figure out how to play sounds. Can't even get the beep(); to work...
Been studying the menu example from AUM 69. I get the WMB unsuported error but the music works fine. I want to make a similar sound options thing as in the AUM menu example - a master voulume, a diffrent volume for wav files, an other for music (midi?) and one for voices.
Is there any tutorial on the net or in a AUM that I've missed that teaches you everything you need about playing sounds? (in Lite-C!) Or would anyone like to explain it for me here and perhaps give me a small code to try?

Re: Playing sounds problem [Re: 4gottenname] #274838
06/28/09 20:04
06/28/09 20:04
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
you should use wav. format

and if you want to play a sound for a damage or something like that u have to write some like this
snd_play(ping,100,0);
this must be in the function who is called wehn un need this sound
othr was when u use to run a sound from the start of your game
you can write in your main

snd_loop(ping,100,0);
and a sound starts and never ends till you write
snd_stop(ping);

you should read in the manual for more to know

Re: Playing sounds problem [Re: GameScore] #274839
06/28/09 20:16
06/28/09 20:16
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
To play a sound, use:
"snd_play".
"snd_loop".

To play a 3D sound from an entity, use:
"ent_playsound".

To play music, use:
"media_play".
"media_loop".

Don't forget the handles!! wink

Re: Playing sounds problem [Re: GameScore] #274842
06/28/09 20:31
06/28/09 20:31
Joined: Jun 2009
Posts: 22
Finland
4gottenname Offline OP
Newbie
4gottenname  Offline OP
Newbie

Joined: Jun 2009
Posts: 22
Finland
I have defined SOUND* testwav = "mouseover.wav"; and call a function with snd_play(testwav,100,0); in it when mousing over a button but i hear no sound. Maybe my wav file has wrong format or something but as I said earlier I can't get the beep sound either. An other problem is that when I test run my script the screen is black and my panel with button dont show (when I've added a snd_play(testwav,100,0); or similar line). I've read the manual and I must be missing something important...

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

Joined: Feb 2008
Posts: 3,232
Australia
Theres not much to go wrong with beep. As long as you are using just
beep(); with the brackets, and no numbers in the brackets.
This triggers the windows "default beep", so it should always work.

Can you post the first 10 lines of an acklog.txt?
Or at least check for these three lines with the first 10 lines.
MM mixer opened
DSOUND device opened
DI interface opened



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

Joined: Jun 2009
Posts: 22
Finland
Took me a while to find the diag option thing...

MM mixer opened
DSOUND device opened
DI interface opened
Start Window opened
(c)Conitec . Dieburg . San Diego . www.3dgamestudio.com
Atari Lite-C - Free Edition V1.70.1 - Feb 5 2009
Development version

Mouse found
SB Live! Wave Device opened
NVIDIA GeForce 7600 GS pure T&L device 1ff9 detected
D3D device NVIDIA GeForce 7600 GS 1ff9 selected.

Re: Playing sounds problem [Re: EvilSOB] #274858
06/28/09 22:18
06/28/09 22:18
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
just try

Code:
void main(){
  wait(1);
  beep();
}


if this works i'm guessing you've not set mouse_mode, so there's no recognition of the mouse being over the panel

Re: Playing sounds problem [Re: MrGuest] #274862
06/28/09 22:29
06/28/09 22:29
Joined: Jun 2009
Posts: 22
Finland
4gottenname Offline OP
Newbie
4gottenname  Offline OP
Newbie

Joined: Jun 2009
Posts: 22
Finland
It dosn't work, I hear no beep.
And I have mouse mode 1 in my other script. Seems to be this SOUND* testwav = "mouseover.wav"; line that makes the screen go black, if it's commented my panel shows. Gona try with some other wav files..


Re: Playing sounds problem [Re: 4gottenname] #274875
06/28/09 23:48
06/28/09 23:48
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Question, go to windows 'Control Panel'/'Sounds and Audio Devices'/'Sounds' Tab/Page.
Then look in the "events" list to see if there is a WAV attached to the "Default Beep" event.

This is the sound 3DGS will play when it hits a beep(); function.
If it is empty, put anything in it (for now), and then test MrGuest's code again.

How did it go?


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

Joined: Jun 2009
Posts: 22
Finland
Ahh, thanx EvilSOB! That solved my beep problem laugh
Default beep was empty! I had it on windows default so kinda strange.
Now I can finaly test if my functions actually are called but I don't think it will solve the other music/wav playing problems.

EDIT: Suddenly got the wav working when copy and pasting from AUM 69 menu code, that changed the name from testwav = "mouseover.wav"; to mouseover_wav = "mouseover.wav";
What was wrong with testwav?? confused

EDIT2: And what format should I use for the music files, since mp3 not suported? Need to find a converter...

Last edited by 4gottenname; 06/29/09 10:07.
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