Quick Search for:  in language:    
WAV,Record,sound,from,Track1,Track2,file
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic
AniViewer
By Jerrame Hertz on 6/30


Click here to see a screenshot of this code!Raw Packet Sniffer
By Coding Genius on 6/30

(Screen Shot)

Check the support of a record set
By Freebug on 6/30


B++ Builder - VB without runtimes
By Anthonius on 6/30


Mr Blonde - Chat Program
By Mr Blonde on 6/30


MSN Messenger Status Detector
By Ryan Cain on 6/30


MSN advanced
By alias1990 on 6/30


MSN Messenger advanced
By alias1990 on 6/30


Locate Database
By Erica Ziegler-Roberts on 6/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Record sound CD (track) to WAV file.

Print
Email
 

Submitted on: 6/14/1999
By: Damjan 
Level: Not Given
User Rating: By 102 Users
Compatibility:VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 11140 times.
 
 
     Record sound from CD (Track1, Track2...) to a WAV file.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Record sound CD (track) to WAV f
'     ile.
' Description:Record sound from CD (Trac
'     k1, Track2...) to a WAV file.
' By: Damjan
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=2091&lngWId;=1'for details.'**************************************

'This control use MCI to control CD

Public Sub RecordWave(TrackNum As Integer, Filename As String)

' TrackNum: track to record ' Filename: file to save wave as On Local Error Resume Next Dim i As Long Dim RS As String Dim cb As Long Dim t RS = Space$(128) i = mciSendString("stop cdaudio", RS, 128, cb) i = mciSendString("close cdaudio", RS, 128, cb) Kill Filename RS = Space$(128) i = mciSendString("status cdaudio position track " & TrackNum, RS, 128, cb) i = mciSendString("open cdaudio", RS, 128, cb) i = mciSendString("set cdaudio time format milliseconds", RS, 128, cb) i = mciSendString("play cdaudio", RS, 128, cb) i = mciSendString("open new Type waveaudio Alias capture", RS, 128, cb) i = mciSendString("record capture", RS, 128, cb) t# = Timer + 1: Do Until Timer > t#: DoEvents: Loop i = mciSendString("save capture " & Filename, RS, 128, cb) i = mciSendString("stop cdaudio", RS, 128, cb) i = mciSendString("close cdaudio", RS, 128, cb) End Sub


Other 9 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
6/15/1999 7:51:00 PM:Chris Wells
I am new to sound recording and the MCI 
control and I was wondering if you 
could explain how the code works.  
Thanks.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/27/1999 8:29:00 PM:Kenneth
Actually, i am looking for capturing 
voice using microphone and storing it 
in .wav format
Any 
help/suggestion/codes ?
Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/3/1999 6:46:00 AM:John
I need to mciSendString declaration
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/4/1999 3:28:00 AM:Viren
GreatJob!I was looking for such a code! 
thanks !!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/4/1999 1:43:00 PM:Geezus
The wav file gets created, but it's 0 
bytes..anyone having similiar problems?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/5/1999 8:15:00 PM:Nick
I'm getting it at 44bytes and it's not 
saving any of the track.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/6/1999 6:19:00 AM:Tigger
Well my setup cant find the class .dll 
'mciSendString'
What ????
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/7/1999 9:01:00 PM:Geezus
ok...i'm getting maybe 2 seconds of the 
track
then it cuts off...anyone fixed 
this yet?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/7/1999 9:39:00 PM:Nate
Man this process is slow. Does anybody 
have a more efficent way of ripping a 
cd other than catching whatever goes 
through the mci? Like just transfering 
sectors over from the cd and saving it 
as a .wav file???
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/8/1999 5:45:00 PM:totong
hey dude! how do this thing work? how 
to use this stuff?
tenks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/10/1999 5:33:00 PM:Richard Burns
Problem Solved: Change This Line 
From,
t# = Timer + 1
To:
t# = Timer 
+ (TRACK LENGTH)
Remember The API 
For Getting The Track Length
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/10/1999 5:34:00 PM:Richard Burns
You can get the code 
from:
http://www.tichtechnology.frees
erve.co.uk
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/10/1999 5:36:00 PM:Richard Burns
Does anyone know how to rip a cd using 
Digital-Audio, eg (AudioGrabber)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/11/1999 9:41:00 AM:Shaun Rossi
This code doesn't appear to DIRECTLY 
'pull' the data trac off the cd-audio 
disc.  It looks like it's recording 
thru the mixer and audio cable that 
connects the cd-rom drive to the sound 
card.  This doesn't do a bit 
extract.... Am I wrong? -Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/12/1999 12:37:00 AM:mespa
does any one have something about 
writing mp3's
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/13/1999 10:13:00 PM:in need of help
i need help...because i cant get this 
program to work, it plays 2 seconds of 
this song and then stops and then 
doesnt even create a file! can anyone 
help?
please,
thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/20/1999 12:45:00 PM:ET
????
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/22/1999 2:30:00 PM:!!!
This program is equivalent to the one 
submitted on 8/30/98 by jacob alberty. 
Jacob should get the award instead!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/24/1999 10:27:00 AM:Athurupana
I am a Programmer from Sri lanka.
This 
is my first access to 
"http://www.planet-source-code.com/vb/" 
I want to know more about visual 
basic.
thanks for your web site.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/24/1999 1:25:00 PM:dead end
if you know how to work this code send 
me and email please or im me on aim sn: 
odeadendo
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/25/1999 10:57:00 AM:Naresh
How do i use this code
IF YOU CAN HELP 
ME PLEASE MAIL ME
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/26/1999 3:26:00 PM:Mike Canejo
add this to your Form to make this 
Fuction work:
Private Declare 
Function mciSendString Lib "winmm.dll" 
Alias "mciSendStringA" (ByVal 
lpstrCommand As String, ByVal 
lpstrReturnString As String, ByVal 
uReturnLength As Long, ByVal 
hwndCallback As Long) As Long
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/28/1999 2:31:00 AM:superior code
I wonder how the judges of this site 
determine the superior code for a month 
- by looking at the description or the 
code? I don't believe that they have 
try the programs out!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/28/1999 5:05:00 AM:NaRc
Shaun - Corret, this is not a bit, or 
byte, 
ripper such as "AudioGrabber" 
or NaRc's 
MPEG Workshop ;) use. They 
are created
in C/C++ for speed and 
since VB cannot
modify a byte directly 
you wold have to
use an addon or OCX 
such as "Dialog-Medien 
ACD Control 
(www.dialog-medien.de)" to
implement a 
byte ripper into a VB program.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/29/1999 11:09:00 AM:Anthony
PLEASE HELP (URGENT)- I am new to VB. I 
am using vb6, so when I copy the code, 
where do I paste it. Please mail me. 
Very urgent. Thank you.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/30/1999 9:19:00 AM:Asyong Salungga
I'd like to produce a program on CD 
that will automatically execute 
whenever the CDROM is placed inside the 
drive. Any suggestion?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/30/1999 9:23:00 AM:LOGIX
THIS CODE stinks, sure it works but you 
have to fix it first!, How the judges 
pick these!  All you did was make some 
links to dll files, and u did the WRONG!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/17/1999 10:28:00 AM:Etien
Planet-Source-Code Please Zip all of 
the code instead of just putting it 
on
a web-page,thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/17/1999 7:06:00 PM:Neil RAmsbottom
Grrrrr, every peice of code like this 
creates a file about 19KB long.
Anyone 
got any comments?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/18/1999 9:16:00 PM:Wacko
I added that code to a .bas file, now 
what?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/18/1999 9:24:00 PM:Wacko
I got mine working but it only records 
about 2 seconds worth.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/23/1999 2:49:00 PM:DashiarD
Are you fool?
This code is best it can 
be. Do you know what a DLL is used for 
when you blame this code and his 
creator?
and for others. First read 
the comments be4 asking a question - 
someone may have asked it be4 you. And 
the others, do NOT be lame. First 
explore all the secrets of your VB and 
THEN come here to get code. These 
aren't for the VERY starters.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/25/1999 9:50:00 PM:Al
Like your new format..Keep up the pace.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/3/1999 4:35:00 AM:Dine
I am trying to work put how to set my 
CD Rom to rip at 4x it is capable of it 
and does it with audiograbber, anyone 
care to enlighten me?  Tanks...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/22/1999 5:07:00 AM:Rich
Asyoung, you can make a cd 
automatically start up by placing a 
file called autorun on your cd, not 
sure the parameters you have to pass 
this file, been a while since i used 
it. Look in your VB help for autorun, 
may be there.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/2/1999 7:57:00 PM:exxd
if you are having problem with the .wav 
file it might be cuz you need to close 
the capture after your done 
recording.
i = mciSendString("close 
capture", 0&, 0, 0)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/4/1999 8:26:00 AM:TWEAKER
I need help getting it to work.
So far 
I coped it to the form 
(code)
HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/4/1999 8:42:00 AM:TWERKER
SORRY I PUT WRONG E-MAIL
I THINK. 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/4/1999 8:44:00 AM:TWEAKER
MY E-MAIL IS TWEAKERBM1@AOL
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/14/1999 10:09:00 AM:mickey maharajh
Does anyone have vb code that can 
playback a CD, Wav file or MP3 file at 
1/2 speed 1/4 speed etc.????
Any help 
would be greatly appreciated.
my 
email is 
wabb60@hotmail.com
Thx
Mickey
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
12/31/1999 11:06:02 PM:Mouse
ok this code works... at first it 
didn't, but, when modified it does... 
all you "Cut And Paste" programmers run 
to these sights and expect the gracious 
programmers who dedicate this code to 
you people to write your programs for 
you, and if they sent you something 
wrong, you jump all over them and say 
they suck... grow up and learn to 
program before you make pointless 
comments...and to the programmers 
dedicating this source, thank you very 
much for your time... -mouse
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/16/2000 8:25:33 PM:Jeff katz
I Agree Totally... They Shred Me 2 
pieces When I Make ONE LITTLE 
MISTAKE.
Grow Up!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/23/2001 6:54:58 AM:Gaz
Anyone know how to turn a .wav file 
into a list of numbers representing the 
amplitude at each sample - i.e. a text 
file like sound is stored in unix
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/8/2003 3:55:52 AM:Wouter van Koppen
nouw t werkt niej hoor...
mci nogwat 
is niet defined
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.