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 / Um.. recording output

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 21st Sep 2003 20:50
is there anyway of recording the output of the computer speakers to a file. Can it be done with dark basic pro? Can it be done at all?

e.g. I play a sound through my computer speakers. and it gets recorded.

Please dont reply to say "Why on earth would you want to do that"

>>TerraByte. Putting the Byte back into Terragramming<< Life is like a sheet sandwich you take a bigger piece everyday.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Sep 2003 21:57
Yes you can. There is a driver out on the internet somewhere, and I can't remember it's name right now! You use it as the output device, it records the throughput, and passes it on to the actual hardware device.

Lets you record streaming audio too. Won't record MIDIs, these aren't processed 'til it reaches the soundcard.

I'll let you know if I remember it's name.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
ESC_
22
Years of Service
User Offline
Joined: 29th Aug 2003
Location: Mass.
Posted: 21st Sep 2003 22:09
This snippet first plays from a cd in the cd-drive, and then captures from the soundcard:

Sync On
Sync Rate 0

Set window on
Set window title "Record WAV from CD"

Load dll "winmm.dll",1

tracknum=1
filename$="C:\cdtrack1.wav"

rs$=" "
i = Call dll(1,"mciSendStringA","stop cdaudio",rs$, 128,cb)
i = Call dll(1,"mciSendStringA","close cdaudio",rs$, 128,cb)

If file exist(filename$) then delete file filename$

rs$=" "
i = Call dll(1,"mciSendStringA","status cdaudio position track "+str$(tracknum),rs$, 128,cb)
i = Call dll(1,"mciSendStringA","open cdaudio",rs$, 128,cb)
i = Call dll(1,"mciSendStringA","set cdaudio time format milliseconds",rs$, 128,cb)
i = Call dll(1,"mciSendStringA","play cdaudio",rs$, 128,cb)
i = Call dll(1,"mciSendStringA","open new type waveaudio alias capture",rs$, 128,cb)
i = Call dll(1,"mciSendStringA","record capture",rs$, 128,cb)

t# = Timer() + 10000
Repeat
Until timer()>t#

i = Call dll(1,"mciSendStringA","save capture "+filename$,rs$, 128,cb)
i = Call dll(1,"mciSendStringA","stop cdaudio",rs$, 128,cb)
i = Call dll(1,"mciSendStringA","close cdaudio",rs$, 128,cb)





You should only need these lines for sound capture:

i = Call dll(1,"mciSendStringA","open new type waveaudio alias capture",rs$, 128,cb)
i = Call dll(1,"mciSendStringA","record capture",rs$, 128,cb)

i = Call dll(1,"mciSendStringA","save capture "+filename$,rs$, 128,cb)

"That's not a bug, it's a feature!"
"Variables won't, constants aren't."
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 21st Sep 2003 22:59
BatVink, if you remeber the name of the driver please do tell me as thats the way ill do it i think

ESC 2 things, nice code snippet, i may havea use for that later. Second thing is i had that avatar ages ago ...soz..just one of those things i notice

>>TerraByte. Putting the Byte back into Terragramming<< Life is like a sheet sandwich you take a bigger piece everyday.
ESC_
22
Years of Service
User Offline
Joined: 29th Aug 2003
Location: Mass.
Posted: 21st Sep 2003 23:18
Yeah, I might change my avatar back to meatwad, which I usually use

"That's not a bug, it's a feature!"
"Variables won't, constants aren't."
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Sep 2003 00:01
Found it again!

Quote: "Total Recorder records streaming audio from media players, microphone input, line-in input, DVDs, or CDs. The resulting files can be saved in WAV or MP3 format. Total Recorder can also convert different sound formats to WAV or MP3."


http://download.com.com/3000-2169-10203429.html?tag=lst-0-4

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Sep 2003 15:30
Open the sound volume settings, open the recording options, select the mixed output option. That's it - you can record the sound card output to a wave file, that's how VSD Tracker exports to wav, it uses code similar to ESC's.


Van-B

My cats breath smells of cat food.
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Sep 2003 16:37
Van B: Can you expand on that one...I have "Stereo mix", is that what you mean? Is there any info on recording it to a wav using this on the net anywhere?

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Sep 2003 16:47
I don't think every setup supports it, but on my soundcard it's mixed output, try Stereo mix and see what it does - I reckon it should be the same thing. One thing though, keep the output volume at about half, that's about right for avoiding distortian.


Van-B

My cats breath smells of cat food.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 22nd Sep 2003 18:35
Thanks everyone


>>TerraByte. Putting the Byte back into Terragramming<< Life is like a sheet sandwich you take a bigger piece everyday.

Login to post a reply

Server time is: 2026-07-25 07:01:36
Your offset time is: 2026-07-25 07:01:36