Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

continuous WAV recorder "one button ware"

null
0
norb
Asked:
norb
  • 7
  • 5
  • 3
  • +1
1 Solution
 
nobody11Commented:
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
 
norbAuthor Commented:
Edited text of question
0
 
chensuCommented:
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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
norbAuthor Commented:
Edited text of question
0
 
vinniewCommented:
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
 
norbAuthor Commented:
Edited text of question
0
 
chensuCommented:
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
 
chensuCommented:
Have you recorded anything?
0
 
vinniewCommented:
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
 
vinniewCommented:
send e-mail to vinnie@usa.net
0
 
vinniewCommented:
whoops,  vinnieW@usa.net
0
 
chensuCommented:
Send it to chensu@hotmail.com
0
 
chensuCommented:
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
 
vinniewCommented:
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
 
chensuCommented:
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
 
chensuCommented:
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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

  • 7
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now