Important alert: (current site time 7/16/2013 2:36:01 AM EDT)
 

winzip icon

WaveIn Recorder

Email
Submitted on: 6/15/2006 7:32:22 PM
By: Arne Elster 
Level: Advanced
User Rating: By 61 Users
Compatibility: VB 6.0
Views: 41132
author picture
(About the author)
 
     Uses the waveIn API to record audio signals. You can change the recording source while recording and change its volume. The recorded samples get saved to a WAV file, with full ACM support, so you can even use an MP3 codec, if installed. The recorded samples get visualized through a frequency spectrum (Ulli's FFT class) and an amplitudes curve. Tested with XP. /// Update: Replaced the common dialog control with a class by Bill Bither (found at PSC), added some comments to the code, cleaned up a bit /// Update: fake window will be ceated only on start of recording, secured some parts in WaveInRecorder where pointers are used /// Update...: replaced subclassing with Paul Caton's technique /// update...: mixer functions should work fine now, uses a real mixer handle now ;), also the inverted line selection bug is fixed /// and once more...: mixer functions should be really stable now, added effects (echo, amplify, phase shift, 7 band graphical equalizer). Tipp: add echo, give it a short length (about 4-5 pixels to the left from the default) and set the echo amp to 6, makes your recording sound like a robot :)

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
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.


Other 23 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced 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/14/2006 7:10:59 AMRichard Mewett

Excellent (as always). Compact, clean & well formatted. *****
(If this comment was disrespectful, please report it.)

 
6/14/2006 9:00:25 AMmr. B

Excellent program !!!
It's the best on PSC I think.
5 globes from me.
(If this comment was disrespectful, please report it.)

 
6/14/2006 10:56:32 AMRuturaj

Hi! Just saw your profile ... are you really 16 years old?!?! Looking at your programs, just can't believe it! Are you really 16 years old?!?!?!?!
(If this comment was disrespectful, please report it.)

 
6/14/2006 12:41:03 PMRobert Rayment

Looks great but for some reason I am getting 'ShowOpen' failed on the Output button and locks up on Debug?
(If this comment was disrespectful, please report it.)

 
6/14/2006 1:01:31 PM[rm_code]

Forgot to update it. I'm 17.
(If this comment was disrespectful, please report it.)

 
6/14/2006 1:17:31 PM[rm_code]

Richard and mr.B, thanks for the votes.
(If this comment was disrespectful, please report it.)

 
6/14/2006 1:39:44 PM[rm_code]

Robert, try to run it compiled. It uses a little hack (by vf-fcro, can be found somewhere on PSC) to recieve window messages in the recorder class.
That is unsecure subclassing and therefore you shouldn't debug ;)
(If this comment was disrespectful, please report it.)

 
6/14/2006 2:03:33 PMHeriberto Mantilla Santamaria

Yeah another nice app for rm_code, 5*
(If this comment was disrespectful, please report it.)

 
6/14/2006 2:22:53 PMRobert Rayment

Yes I tried EXE but then the output button just closes the app. Clearly others and you have no problem - curious. Btw VB6 on WinXP SP2. The CommonDialog ocx is Ok on my PC but perhaps a version problem?
(If this comment was disrespectful, please report it.)

 
6/14/2006 4:49:20 PM[rm_code]

Robert, maybe - my comdlg32.ocx is 6.00.8418
(If this comment was disrespectful, please report it.)

 
6/14/2006 4:53:50 PM[rm_code]

Oh, and comdlg32.dll is 6.00.2900.2180 (xpsp_sp2_rtm.040803-2158)
(If this comment was disrespectful, please report it.)

 
6/14/2006 6:11:46 PMRobert Rayment

Could be, my comdlg32.dll is the same but my comdlg32.ocx is 6.1.97.82
(If this comment was disrespectful, please report it.)

 
6/14/2006 7:04:24 PM[rm_code]

Robert, I replaced the control with a class. I'm curious if that helped?
(If this comment was disrespectful, please report it.)

 
6/14/2006 7:36:53 PMKevin Ritch

It crashes out completely on my new ACER TravleMate (XP) with 1 Gig of ram. Any ideas? TIA

Best regards,
Kevin
(If this comment was disrespectful, please report it.)

 
6/14/2006 8:42:26 PMDave

Excellent work rm! The program crashes for me as my sound card dosen't have a microphone/line-in socket.

Keep working on this, would love to see it mature into a great freeware recorder.
(If this comment was disrespectful, please report it.)

 
6/15/2006 1:19:36 AMRobert Rayment

rm: Still getting MS Error Window with latest version for the EXE - not to worry, maybe something odd on my PC :(
(If this comment was disrespectful, please report it.)

 
6/15/2006 3:17:33 AMRobert Rayment

Just seen the other comments (moderator system can muddle them) - Now looks like a sound card limitation on my NVIDIA card.
(If this comment was disrespectful, please report it.)

 
6/15/2006 4:31:37 AM[rm_code]

Dave, where does it crash?
When loading or when recording? Or when selecting a file...?
Robert, until recording nothing should crash. The only functions using CpyMem are CreateDelegate and the window proc.
Anyone have a 64 bit CPU?
(If this comment was disrespectful, please report it.)

 
6/15/2006 5:59:34 AMRobert Rayment

rm: Found it now working with mono mix while playing the free program ReadPlease. Crashed once when pressing the Output filename button but mostly OK. Noted that the volume slider has to be turned well down(eg 10%) else distorted. So still slightly unstable (no idea why) but super stuff *****
(If this comment was disrespectful, please report it.)

 
6/15/2006 6:21:07 AM[rm_code]

Robert, maybe it's the ASM delegate + fake window.
You say, now that the window will only be created on start of recording, it works. I'll try to replace it with Paul Caton's subclassing technique.
(If this comment was disrespectful, please report it.)

 
6/15/2006 6:54:37 AM[rm_code]

I should add a distort-o-meter :) Or at least a simple vu...
(If this comment was disrespectful, please report it.)

 
6/15/2006 8:45:33 AM[rm_code]

Messed up changing the volume. Will be fixed in the next bigger update, you can fix it yourself by replacing line 830 in WaveInRecorder with: MixerSetConnectionVolume lngCurDev, i, SelectedMixerLine, udtVol
(If this comment was disrespectful, please report it.)

 
6/15/2006 8:49:16 AM[rm_code]

Kevin, sorry, overlooked your comment.
When exactly does it crash? Right after starting it or when trying to record something?
(If this comment was disrespectful, please report it.)

 
6/15/2006 9:06:45 AMTimo

I had en fatal error. VB6 closed, when I selected the audio device.
But it looks great.
(If this comment was disrespectful, please report it.)

 
6/15/2006 9:10:33 AM[rm_code]

The same for line 814...
replace with: udtVol = MixerConnectionVolume(lngCurDev, i, SelectedMixerLine)
(If this comment was disrespectful, please report it.)

 
6/15/2006 10:44:14 AM[rm_code]

Timo, which Windows version are you using?
(If this comment was disrespectful, please report it.)

 
6/15/2006 11:25:30 AMFrédéric Côté

I have a problem when selecting input Line in the program. I opened sound control to see what it was selecting. When I choose stereo mixer, it really selects microphone and when I select microphone, it really selects stereo mixer. Every other choices are coupled with another one and inverted like that.
I have french win2k with a crappy onboard sound (SiS 7012). When I select the right one, the program is recording fine though :)
(If this comment was disrespectful, please report it.)

 
6/15/2006 11:37:42 AM[rm_code]

read my comments 8:45:33 and 9:10:33. Fill be fixed with the next update.
(If this comment was disrespectful, please report it.)

 
6/15/2006 12:03:06 PM[rm_code]

Just 1 bug remaining... have to replace GetMixerLine with an other function. GetMixerLine can cause strange crashes.
(If this comment was disrespectful, please report it.)

 
6/15/2006 12:57:09 PMBert

Great code! I've been looking for something like this a long time, thanks.

I also get error messages when I open the mixer device and mixer line.
But when I record, it works fine, so is no problem for me.

I will study your code to figure out how everything works, I'm just a beginner, so your code is very helpful to me, I learn from people like you :-)

Thanks

Bert
(If this comment was disrespectful, please report it.)

 
6/15/2006 1:32:27 PM[rm_code]

Bert, what are these error messages?
(If this comment was disrespectful, please report it.)

 
6/15/2006 7:16:20 PMOption Explicit

rm_code, you are definitely the Sound Master of PSC... this is great stuff. Love your technical expertise and clean coding style! Thanks for another classic.
(If this comment was disrespectful, please report it.)

 
6/16/2006 4:15:43 AMSteve Abbott

Shear genius! I needed a "simple" bit of code to ensure that microphone input was "on". Your versions before the latest one managed to crash obscurely, but this latest one works brilliantly. Sincere thanks for such a great job.
(If this comment was disrespectful, please report it.)

 
6/16/2006 4:34:14 AM[rm_code]

Yei, it works :D finally settled down. Thanks, Steve :)
(If this comment was disrespectful, please report it.)

 
6/16/2006 7:06:54 AM[rm_code]

Thanks, Option Explicit :)
(If this comment was disrespectful, please report it.)

 
6/16/2006 7:48:01 PMCodeFester

I like it alot... Nice submission and thanks for sharing it. Your code runneth over... 5 nutz from texas for you.
(If this comment was disrespectful, please report it.)

 
6/17/2006 3:39:23 PMSteve Abbott

Now I've got your code working well in some old VB6 programs I'm getting greedy. Is there any chance of you porting it to VB.Net in which I write all my current programs? I tried the automatic translation in DotNet but the code just isn't happy being translated in that manner (that's NOT a criticism of your code - just a reflection on VB6 and DotNet coding styles) and it would have been too dangerous for me to try to rewrite it in a more native DotNet mode.
Thanks
Steve
(If this comment was disrespectful, please report it.)

 
6/18/2006 6:18:08 AM[rm_code]

I don't like VB.Net, I don't want VB.Net.
But I think, there should be plenty of tutorials out there how to convert VB classic to .Net.
(If this comment was disrespectful, please report it.)

 
6/19/2006 11:16:18 AMFrédéric Côté

Hi, I still had the same problem described in the previous comment with the current version, so I looked more into it. I found the 2 lines that needed to be changed in the waveinrecorder class. I had to change in the SelectMixerLine function:
SelectMixerLine = SetMixerLine2(hMixer, MixerLineCount - Index - 1)
to
SelectMixerLine = SetMixerLine2(hMixer, Index)
and in the SelectedMixerLine function:
SelectedMixerLine = MixerLineCount - GetMixerLine2(hMixer) - 1
to
SelectedMixerLine = GetMixerLine2(hMixer). Now everything is working correctly, at least for me.
(If this comment was disrespectful, please report it.)

 
6/20/2006 9:14:13 AMFrédéric Côté

I had to make those changes on both machines here that are running french win2000 pro, but at home, nothing needed to be changed on english winxp pro. What did Microsoft do to french versions?
(If this comment was disrespectful, please report it.)

 
6/21/2006 7:01:21 AMT Jackson

Yeah VB.net is an entirely new learning curve and ultimately the next generation of BASIC if we like it or not. Beginners All Purpose Symbolic Instruction Code.net
(If this comment was disrespectful, please report it.)

 
6/25/2006 12:24:24 PMkilll

Great!
analyze the wave more!

try to show the detailed "wave".

like goldwave, audition...
(If this comment was disrespectful, please report it.)

 
8/16/2006 9:44:34 AMValdir Lima - Brazil

Muito bom, era o que eu estava procurando. Very good! Excellent
(If this comment was disrespectful, please report it.)

 
8/16/2006 1:15:52 PMValdir Lima - Brazil

Rm_code is occurring an error. "Couldn' t select device!" upon selecting the plate of sound. I am using a Creative Sound Blaster 16 ISA. Please help me in this problem. I am using a "translator" therefore do not I speak English. I am in Brazil.
(If this comment was disrespectful, please report it.)

 
9/1/2006 10:57:27 AMLeBruce-Poland

Your apps are really graet. I think you should start some software business with your excellent programming skills :)

P.S. This app works perfectly for me!
(If this comment was disrespectful, please report it.)

 
10/19/2006 4:18:33 AMxsc

wow it's a great code!
btw how can i use the mp3 codec?
(If this comment was disrespectful, please report it.)

 
11/7/2006 8:38:13 PMNino R.

Nice. So good that I replace my old PCM wave recorder with this ACM recorder. And it is now part of my karaoke recorder program. Took everything but effects, DirectX are better. Never mind, thank you for shareing this code with us.
by, nino
(If this comment was disrespectful, please report it.)

 
11/14/2006 12:15:02 PMNicos

Hi, Great software!!! Is there a possibilty to monitor the level with the vu-meter before the audio is record? I've tried something, but it doesn't work.
(If this comment was disrespectful, please report it.)

 
12/30/2006 4:30:21 AMLevente

Dein Program arbeitet sehr gut. Es ist eine saubere arbeit.
(If this comment was disrespectful, please report it.)

 
1/7/2007 4:48:31 PMsunseeker

GREAT, GREAT CODE!!!!!!!
(If this comment was disrespectful, please report it.)

 
1/23/2007 1:33:32 AMNS

Great! Excellent program!
(If this comment was disrespectful, please report it.)

 
1/23/2007 1:35:00 AMNS

Excellent Code!
(If this comment was disrespectful, please report it.)

 
3/7/2007 3:13:18 AMTimo Böhme

Really nice to share your code with us. Next step could be to include any Codec to save the file. Like the Lame.exe.
(If this comment was disrespectful, please report it.)

 
7/24/2007 3:18:14 PMPeterson Menezes Trindade

Somebody obtained to record direct for MP3?
(If this comment was disrespectful, please report it.)

 
10/25/2007 4:24:00 PMN Duffster

I've used your code in a program I made and have been using for the past year. It records songs from websites and converts them to mp3. (record streamed audio). Just wanted to say thx
(If this comment was disrespectful, please report it.)

 
11/4/2007 6:48:42 PMBarcrest

Anyone been able to get just the meters working out of this without recording? I am playing with it now but it wasn't as straight forward as just disabling a few lines.
(If this comment was disrespectful, please report it.)

 
11/25/2007 7:52:54 PMDadalee

gr8 code !
can anybody make this through to the speaker without recording ?
(If this comment was disrespectful, please report it.)

 
3/5/2008 6:30:14 AMTom Weber


Too bad that there are Vista compatibility issues, and it doesn't work there (no devices found). I haven't been able to find a solution yet.
(If this comment was disrespectful, please report it.)

 
4/3/2009 5:53:24 PMMedo

Thanks
you deserve 5 starts
(If this comment was disrespectful, please report it.)

 
4/25/2009 5:38:26 AMFadhlur

Great! Excellent program !!!
It's the best on PSC I think.
5 globes from me.

I use this code to record my music and result 2 fle wav, but I can't record separate one left channel and other Right Channel .
I haven't been able to find a solution yet. anybody can help me?

(If this comment was disrespectful, please report it.)

 
10/5/2009 11:45:06 PMJohnAllan

Brilliant code.
(If this comment was disrespectful, please report it.)

 
11/29/2009 5:28:21 PMEsteban Mackay D.

This app works for me but i can't select audio mix on DELL computer because it not have audio mix.In other computer I have to open sound control to selected audio mixer to record all wave output. This app don't change the hardware selection. How to this.
(If this comment was disrespectful, please report it.)

 
7/22/2010 7:14:04 AMWookie

Brilliant bit of code. Comprehensive and versatile. 5 globles! One question which seems to have been asked but not answered is how do you use it to record direct to MP3?
(If this comment was disrespectful, please report it.)

 
10/15/2010 8:39:34 PMStanM

Very nice. Helped me solve an urgent problem! Thanks!
(If this comment was disrespectful, please report it.)

 
11/18/2010 6:21:39 AMzhang

nice :)
(If this comment was disrespectful, please report it.)

 
3/4/2011 12:57:26 PMRoby66

Hi, I think you are a great programmer, please, let me know, can I record an audio file directly in mp3 format using WavwIn Recorder?

Thanks
Roberto
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.