Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Sound Problems #129325
05/10/07 19:04
05/10/07 19:04
Joined: Mar 2007
Posts: 69
L
luke_was_ere Offline OP
Junior Member
luke_was_ere  Offline OP
Junior Member
L

Joined: Mar 2007
Posts: 69
I want to have a WAV file that plays in the background looping, it is ambient city noise like cars beeping etc....

here is the code i have used to put the sound in and it loads the file and runs the script but wont actually play the sound thru the speakers


sound background = "background.wav";
var_nsave background_handle;




background_handle = snd_play(background, 75, 0);


any ideas?

Re: Sound Problems [Re: luke_was_ere] #129326
05/10/07 19:08
05/10/07 19:08
Joined: Feb 2006
Posts: 302
Beienrode/NDS/GERMANY
Dj_Pint Offline
Senior Member
Dj_Pint  Offline
Senior Member

Joined: Feb 2006
Posts: 302
Beienrode/NDS/GERMANY
hmmmm,are the speakers on?^^ try to use this:


background_handle = snd_play(background, 75, 0);
if(background_handle == 0)
{error("[censored], no sound!");}
then u see if the soundis played and stuff...


if u want to see some stuff i made, go to youTube and search for djpint, not dj pint^^
Re: Sound Problems [Re: luke_was_ere] #129327
05/10/07 19:09
05/10/07 19:09
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
sound background = "background.wav";
snd_loop(background,75,0);

And be sure that WAV format is OK, check help for this.

Last edited by tompo; 05/10/07 19:10.

Never say never.
Re: Sound Problems [Re: tompo] #129328
05/10/07 19:13
05/10/07 19:13
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Yes, use sound_loop and not sound_play if you want it looping.

Be sure to declare the SOUND and VAR_NSAVE handle variable outside of any function, but then call the snd_loop, from within a function.


Cougar Interactive

www.zoorace.com
Re: Sound Problems [Re: Ran Man] #129329
05/10/07 23:28
05/10/07 23:28
Joined: Mar 2007
Posts: 69
L
luke_was_ere Offline OP
Junior Member
luke_was_ere  Offline OP
Junior Member
L

Joined: Mar 2007
Posts: 69
i checked the sample rates supported in WED and converted my file to 22Kb sample rate rather than 16, also checked speakers were on!

But still no joy,

Then when i added this code:

if(background_handle == 0)
{error("[censored], no sound!");}

it displayed the error which i guess means it isnt playing the sound.


I have also tried using an MP3 file and a MID file but these two chuck up errors about the file type not being supported even though it says it is in the manual.


Im stuck here :-(

Cant really see whats wrong.

Re: Sound Problems [Re: luke_was_ere] #129330
05/11/07 00:22
05/11/07 00:22
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline
User
MrCode  Offline
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
You have to use media_play/loop to use mp3s, mids, avis, and wmvs.


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Sound Problems [Re: MrCode] #129331
05/11/07 09:34
05/11/07 09:34
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
be sure that your wav file is in main folder or you have a path to it at the top of main script.
Try use more simple example without handle.

Before your main script write:
sound background = "background.wav";
and below main function write
starter start_loop
{snd_loop(background,100,0);}

and try to use another sound... f.e. one from templates and we'll see what happen.

Last edited by tompo; 05/11/07 09:36.

Never say never.
Re: Sound Problems [Re: tompo] #129332
05/11/07 10:30
05/11/07 10:30
Joined: May 2006
Posts: 148
Latvia
MTD Offline
Member
MTD  Offline
Member

Joined: May 2006
Posts: 148
Latvia
Try to play a simple sound file in windows media player. If you here sound then your hardware is o.k. Else you don't have a sound cards

If everything is o.k. than check your wav file summary , and check what audio format you have. If it is a PCM than o.k. else maybe there is the problem...

Re: Sound Problems [Re: MTD] #129333
05/11/07 11:00
05/11/07 11:00
Joined: Apr 2007
Posts: 29
R
Raymaker Offline
Newbie
Raymaker  Offline
Newbie
R

Joined: Apr 2007
Posts: 29
Hey i had some problems with the sound to;
I had a cute little game I made for my mother (very simple: to pop-up all the baloons before the time runs out; you'll know where the baloon is coming from when you hear the sound coming from the left or from the right) but I couldn't make it play to the right side even if I put the balance to 100. After some time I realised that the problem is (I guess) the sound is mono; but when I reconvert it to stereo the engine shouts "Unknown sound format" or something like that what should i do?? THNX in advance!!!!

Re: Sound Problems [Re: Raymaker] #129334
05/11/07 11:20
05/11/07 11:20
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
Raymaker... check the manual about WAV format (bitrate)


Never say never.
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