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.

DarkBASIC Professional Discussion / More sound problems! :(

Author
Message
lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 26th Aug 2003 01:06
I want to have a sound in a continuous loop but it plays too fast i want to double the sound speed but dbp does not let me do this i have to multiply it by 1000 or else nothing, any suggestions?

if s#<4 then e# = 20000
if s#>4 and s#<8 then e# = 30000
if s#>8 then e# = 40000
set sound speed 1,int(e#)

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 26th Aug 2003 01:32
You can get any sound speed you like, within the maximum frequency range of your sound card. You need to know what frequency the sound is you're loading. It'll either be 44100, 22050 or 11000. Any other sample rate it possible, but they are the most likely ones. Then you need to double the speed based on its base value, so if you've loaded in a 22050 sample, then to get double speed you'll need to set it to 44100.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
adr2
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 26th Aug 2003 01:46
If you load the sound (assuming it's a vanilla WAV file) into sndrec32 then click file properties I'm pretty sure it'll tell you the sample rate.
randi
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 26th Aug 2003 01:47
Blah - Blah - Blah!!!
Like you know what you're talking about.
Now look who is trying to impress!!!



Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 26th Aug 2003 02:00
That was directed at me btw. Just in case anyone thought Randi was being randomly vindictive. I would reply to her, but I saw on a TV program somewhere you're supposed to ignore stalkers, otherwise it just encourages them.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 26th Aug 2003 02:01
Says it is 11khz when i left clcik and look at properies!

lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 26th Aug 2003 02:01
lol

randi
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 26th Aug 2003 08:57
Yes... when I was typing, adr2 had not posted yet.
It was aimed at Fallout. Everything is aimed at him!!!


I would reply to her, but I saw on a TV program somewhere you're supposed to ignore stalkers, otherwise it just encourages them.
That's the best you can do??

I'm disappointed in you Fallout.

Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 26th Aug 2003 11:26
Keep it civil children, this isn't a school yard.

Cheers,

Rich

"Gentlemen, we have short-circuited the Universe!"
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 26th Aug 2003 13:33
Don't worry Rich. She puts up a front on DBPro to try and tease me, then blows me sweet kisses on Yahoo Messenger.

... and we never deface posts with our antics until the posters problem is solved.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 26th Aug 2003 14:21
is some one gonna help me?

OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 26th Aug 2003 14:49
I dont think BASS or the other will let you change the speed of WAV's either - I'll have a look later.


Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 26th Aug 2003 14:57
Jesus H Christ! Ok, let me type out what I wrote again and explain it more clearly.

Sound samples are loaded in. They have a sample rate, which is how many samples of sound are played per second. The typical sample rates are 11025, 22050, 44100.

This is the initial speed of your sample. If you've loaded in a 22050 sample then:
(1) To double the speed of playback (and half the length) Set sound speed num,44100
(2) To half the speed of playback (and double the length) set sound speed num,11025

If you're asking for a way to lengthen or shorten the sound sample without making it sound "slow motion" low pitched, or "chipmunk" high pitched, then the answer is no, you can't do that, and there are unlikely to be any work arounds because raising or lowering pitch without time stretching, or time stretching without raising or lowering pitch is a CPU intensive operation.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 26th Aug 2003 16:27 Edited at: 26th Aug 2003 16:28
I made this quick code to show you what i mean and here is the sound.

http://www.apollo-design.com/engine2.zip





The first snippet does not play the sound at the speed i want it playing, while the second does but there is a gap between loops!

lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 26th Aug 2003 16:34
ok forget it it's cos i had loop sound in the main loop i thought i would need this in the loop though but i guess not.

thanx everyone

lcfcfan
23
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 26th Aug 2003 16:55
one more question is there a better and easier way to increase sound speed than how i am currently doing it?



my cars speed goes to 40 and ever 1 added to the speed i want to make the sound slightly faster which i have done but is there a way to get it to increase speed when the engine does?

adr2
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 26th Aug 2003 20:29
Why not link the sound directly to your speed?

set sound speed 1, int(speed#*500)+11025

play around with the 500 figure ...

Login to post a reply

Server time is: 2026-07-23 00:17:30
Your offset time is: 2026-07-23 00:17:30