Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sound problem.

Author
Message
Guillermo
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: United States
Posted: 25th Feb 2003 21:38
When I make a program to play a sound, it produces wat sounds like a sawtooth noise at the begining, while the mouse is down. How can this be corrected.

Here is the program:

sync on : sync rate 0 : backdrop off
set text font "arial" : set text size 16
set text to bold : set text transparent
rem Load sound
load sound "c:\A\Arp.wav",1

do
if mouseclick()=1
if mousey()200 and mousey()
Zach
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: Ms, USA
Posted: 26th Feb 2003 02:41
I'd say it's your sound driver, just find out what kind of sound card you have and download the driver. I dont think its darkbasic.

Tupelo, Ms
PiratSS
21
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 26th Feb 2003 02:57
you forgot your loop,sync,endif and play sound 1




Toughest line of codecol$=asc(left(Pcol$)),1+str$(rev)+chr(80)+left(right(mid(name$),1),1)
ToXic
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Australia
Posted: 26th Feb 2003 03:22
You may need to add this to the code, it should stop the sawtooth noise.

If mouseclick()=1
If sound playing(1)=0 then play sound 1
EndIf

ToXic
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Feb 2003 04:10
And then

if mouseclick()=1
if soundplaying(1)=0
play sound 1
soundplaying(1)=1

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
Guillermo
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: United States
Posted: 26th Feb 2003 16:03
It is not my sound card. As a good computer fanatic, I own several computers with added sound and video cards.
RPgamer's suggestion worked. But there was a need for some minor touches for it to work.

if mouseclick()=1 -- this was fine.
if soundplaying(1)=0 (needs space)should be: sound playing (1)
play sound 1
soundplaying(1)=1 The computer did not like this.

Thanks for the advice!!!


Guillermo

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Feb 2003 22:30
Of course I didnt run through the whole code. You would need to have a previously defined variable for soundplaying, sorry if I was confusing.

About the space- whoops!

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2024-09-19 23:07:45
Your offset time is: 2024-09-19 23:07:45