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 / Recording Sound???

Author
Message
ScottyB
16
Years of Service
User Offline
Joined: 26th Jul 2007
Location:
Posted: 11th Jun 2009 18:49
I've tried.

record sound soundnumber,duration
then

stop recording sound

then i get error message.

Could someone please show me how to record a sound from a mic. then be able to save/play it.

Thanks
Peace and out!
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 11th Jun 2009 20:40
what error did you get?

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 12th Jun 2009 00:24 Edited at: 12th Jun 2009 00:25
well what you need to do is first load any sound doesnt matter wat sound it is. then the sound numbero f the loaded sound has to be the same as the sound you are goign to record. Heres and example


Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Jun 2009 16:00 Edited at: 12th Jun 2009 16:00
Quote: "well what you need to do is first load any sound doesnt matter wat sound it is. then the sound numbero f the loaded sound has to be the same as the sound you are goign to record. Heres and example"


Doesn't work with U7.4. I get the same error with or without the initial load sound (which surely shouldn't be necessary anyway ):



Looks very like a bug to me.

Attachments

Login to view attachments
kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 12th Jun 2009 17:43
Wait so you mean after 7.4 theres no way to record sound. I noticed after one of the updates you have to make a .dbpro of the code, and open it as a project not source to be able to load any media. So that might be the promblem.

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jun 2009 22:32
Quote: "then i get error message"

What message?

None of that pre-loading a sound for me... this works just fine:


Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jun 2009 01:44
Quote: "this works just fine"


It does here too - but what's wrong with the earlier, and simpler, snippet (without the load sound)?

kuljot
15
Years of Service
User Offline
Joined: 2nd Jan 2009
Location: sacramneto, ca united states
Posted: 13th Jun 2009 03:00
I'm a little confused. In the hand on dark basic pro vol. 1 it says you have to first laod a sound to record a sound or you will get an error. SO is that only for the earlier versiions or what

Gateway GT5628 Quad Core Desktop Intel Core 2 Q6600 2.4GHz Quad Core 3072MB RAM / 500GB 7200 SATA II Hard drive DVD RW 18X multi dual NVIDIA GeForce 8500GT ....
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Jun 2009 14:21
Couldn't tell you - when I first used the recording command it just worked.

@Green Gandalf,
'record sound 1,3000' - tells DBPro to start recording sound for 3 seconds ... it does not cause DBPro to pause. The recording takes place in the background.

'stop recording sound' - tells DBPro to stop recording the sound immediately.

So you tell it to record, then immediately tell it to stop. I guess that instead of not creating a sound, it could create a zero-length sound. Neither way has any real advantage over the other IMO - one takes less memory, the other allows you to avoid a check.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jun 2009 20:11 Edited at: 13th Jun 2009 20:17
IanM

Thanks. That makes sense - but is not the whole story. The following snippet works fine with your suggested delay added:



If the optional duration parameter is less than the time till the stop recording sound command is executed, why does DBPro need to be told to stop recording? It should already have stopped.

What exactly is stop sound recording doing?

Is DBPro actually still recording even if the duration has been exceeded, but trims the final sound to the required duration (if specified) and creates the actual sound only when stop sound recording is encountered?

kuljot

Quote: "I'm a little confused. In the hand on dark basic pro vol. 1 it says you have to first laod a sound to record a sound or you will get an error. SO is that only for the earlier versiions or what"


Unfortunately, errors and obscurities creep into all tutorials, Help files, etc. My first attempt at learning MicroSoft's Visual Studio C++ stumbled over the "getting started" tutorial which contained at least one coding error. I learnt something by tracking down the bug though.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Jun 2009 20:53
The RECORD SOUND command removes the existing sound, and then initiates recording.
The STOP RECORDING command ensures that the recording stops at the current point (if it hasn't already reached the time limit), then it creates the sound.

So the sound does not exist until you carry out the stop, and you can't start another until you have stopped the previous one.

BTW, the optional parameter is simply an override of the default value of 5000 - there's no difference between the following two commands:


There's a small bug in there too though - if you start recording one one sound, then start recording with different settings on a second sound, the second sounds parameters are ignored (it's still recording), but when you stop recording, the recording is placed in the second sound.

Basically, this will record one second of sound and place it in sound 2:


I believe that something is being done to fix that ready for the next beta.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jun 2009 23:46
Quote: "I believe that something is being done to fix that ready for the next beta."


That's what I like to hear.

Login to post a reply

Server time is: 2024-05-12 18:24:37
Your offset time is: 2024-05-12 18:24:37