Solved

continuous WAV recorder "one button ware"

Posted on 1997-06-21
16
280 Views
Last Modified: 2013-12-03
null
0
Comment
Question by:norb
  • 7
  • 5
  • 3
  • +1
16 Comments
 

Expert Comment

by:nobody11
Comment Utility
For doing audio input looping, see MMSYSTEM.HLP topic waveInAddBuffer(). For 5 minutes x 32kHz x 8bit you need 1MB "looping memory", conventional, locked (by MMSYSTEM's waveInPrepareHeader()) memory should be sufficient if the machine has more than 4MB (under Win31).
The memory you may split into 32KB buffers, each containing exactly 1s of sample data, and delegate the rest of the work (i.e. filling the blocks) to MMSYSTEM. (A bunch of callback handling is required, but this ist almost all.)

But are you dreaming about wave file conversion/compression?
The Real Audio format isn't yet documented, and MP3 is very complicated. (but it's possible to start external conversion programs e.g. in hidden DOS boxes)

0
 

Author Comment

by:norb
Comment Utility
Edited text of question
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
I used two computers to do so. Connect Speaker Out of one computer to Line In of another computer via an audio cable. Run Sound Recorder or other utilities that comes with your sound cards to record it. Using two computers is more stable. BTW, 32kHz is not standard for Microsoft PCM format. It is not supported by many sound cards probably.
0
 

Author Comment

by:norb
Comment Utility
Edited text of question
0
 
LVL 3

Accepted Solution

by:
vinniew earned 50 total points
Comment Utility
I've got the code from MSDN for that...  They have a CWave C++ class that will do exactly what you need.  You would just need to create a separate thread to do it in the background.  I think it outs to a file, so that would probably change too.  If I get bored, I'll take an hour and write the app you were talking about.

V

0
 

Author Comment

by:norb
Comment Utility
Edited text of question
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
Most of the sound cards have four sources directed to recording: MIDI, CD, Line-In and Microphone, which means you can record nothing when another application is playing waveform sound with these sound cards. Of course, you can connect Microphone In or Line-In to Speaker Out via an audio cable on the computer. But, many sound cards are not duplex, which means you even cannot open the recording device (waveInOpen) while another application is playing waveform sound on the same computer. Maybe, your computer has got two sound cards just like my computer. Then you can do it on one computer.
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
Have you recorded anything?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Expert Comment

by:vinniew
Comment Utility
It's done.  Yes, it records fine.  Who wants to help improve the source?  I used MS's MSDN CWave class to do it.  Although it works, it was meant for NT 3.51 and there are memory leaks on NT 4.0 and Win95.  

Anyone want to help debug?

0
 
LVL 3

Expert Comment

by:vinniew
Comment Utility
send e-mail to vinnie@usa.net
0
 
LVL 3

Expert Comment

by:vinniew
Comment Utility
whoops,  vinnieW@usa.net
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
Send it to chensu@hotmail.com
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
vinniew:

I compiled the files you sent to me. In spite of the bugs, it can record nothing when the other applications are playing waveform audio on one computer. On the other hand, when your program is running, the other applications cannot play waveform audio (The wave device is in use.). This is what I thought. This is the hardware limitation. In fact, what your program does is the same as what the recording part of Sound Recorder that comes with Windows does. So, would you please tell me how you recorded fine? In addition, how do you handle the non-standard 32kHz format?


In the E-Mail you sent to me, you wrote:
>By the way, the Disjockey app ( I didn't bother sending the makefile - just
put it all into a project) requires the user to tell what kind of soundcard
they are using.  I'm positive that this isn't necessary, I'm not sure how to get that info
using Win32.

You can use waveInGetNumDevs() and waveInGetDevCaps() to get that information. They return the number of waveform-audio input devices present in the system and their capabilities.

0
 
LVL 3

Expert Comment

by:vinniew
Comment Utility
chensu,

He was talking about recording a song from the radio, right?  If he was talking about recording from a .wav file that's playing... whoa, I'd have to modify the kernel to be double buffering.  I doubt I'd get the source from MS to do that.

I didn't bother with the 32kHz part. Is it *that* important?  

Did you figure out the bugs?  I'd be *really* interested in getting the new and improved CWave, CWaveodev, CWaveidev.  I know it's not much, but it's a building block.  And, I'm using this class in another application.

If you know how to use waveInGetNumDevs and waveInGetDevCaps, can you add it to the class, too?  It would help eliminate some of that hardcoded stuff.

later,

V

0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
vinniew:

Sorry, maybe I misunderstood. I really do not know what he means by recording a song from the radio. Is the output of the radio directed to the microphone in or line in (or other internal connections) of the sound card? If so, the program works. But, you can still use Sound Recorder since norb didn't mention he needed source code.

The 32kHz is norb's request. It is up to norb whether it is important or not.

I haven't started to debug the program because I have little time on it. I am sorry. I would improve it as long as I have time.
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
In the E-Mail norb sent to us, he said he uses line in and 32kHz is important for him. Now that it is clear.

I suggest that you can use any sound recording software (Sound Recorder or other software that comes with your sound card, and there are many freeware and shareware including COOL96), then convert the wave to 32kHz. Or, use vinniew's code to record and add some code to convert before saving. The sound cards cannot record and play 32kHz directly. You cannot guarantee the quality when you convert the standard PCM format (11.025kHz, 22.050kHz, 44.010kHz) to the 32kHz. For conversion, you can refer to the WAVEMIX.DLL source code (standard PCM format conversion) on Microsoft Multimedia JumpStart 2.0 CD-ROM. I wonder why you want 32kHz.

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now