Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Voice recording and playback

Status
Not open for further replies.

OOP

Programmer
Feb 5, 2001
94
SG
Hi,

I'm currently working on recording a Voice, and playback. Is there any references that i can study?
And also is there any pre-built libraries for the Analog to Digital convertion and sampling rate stuff? If not, then think i'll have to come out with the codes for the sampling and so on [dazed]

Any help and comments are greatly appreciated, Thanks
 
hey.

you could use directSound which has a fair bit of recording/playback functions.

i would suggest though that you use the waveOut API.

(include winmm.lib and mmsystem.h)

you will need double buffering using the (user defined) waveOutProc() funtcion.

a fairly nice tutorial can be found here :
i'm currently trying to implement the double/multi-buffering thing myself since i'm trying to program a software synthesizer...

the sampling rate aspect shouldn't be to difficult if you use standart PCM wave files.

anyway, good luck with your voice recording code and i would appreciate to hear about your thoughts about implementing double buffering.
 
Thanks, bio.

For the past few days, i've been researching on the possible ways to do this and i found the following:


This example uses MCI command to record voice and play. Is it a good choice?
Personally, i'm not quite sure about achieving double buffering in this application...
 
if your program only requires recording and playback then using mci should be fine (and also easier to use)

however, if you want to include low-level audio functions, multiple plackback or anything like that then the waveIn-waveOut interface would be a better choice.

is the voice recording/playback functionality part of a bigger program or actually the only purpose of your program?

these links might also help:


 
This functionality is for integration into a bigger part of a problem. I'm also wondering if its possible to record multiple channels simulanteously (recording 5 different voices at the same time)..For example, the recording will start after a hard-wired switch is pressed..
 
what soundcard(s) are you using ?

could you maybe describe the application you are building a bit more detailed ?

i don't think that you can use MCI for multiple channel recording, but i'm not sure.

for the recording bit i would use the following waveIn functions (in that order)

waveInGetNumDevs(): find number of available audio drivers

waveInOpen(): open instance of audio input device (you might need one instance per channel, depending on your hradware)

waveInPrepareHeader(): prepare header and audio block for input (at least one per channel)

waveInStart(): starts recording (again, use one function call per channel)

waveInStop(): stops recording (one per channel...)

waveInUnprepareHeader(): releases previously prepared waveInHeaders

depending on how long the audio input is you might need to use buffers (...)
for waveIn there is a special function, called waveInAddBuffer(), that adds a buffer to the record queue.

do you want to save the audio input only temporarily for playback or to a .wav file or ??
if it's the latter, you moght wanna take a look at this :

c ya, bio4ema
 
Thanks bio for your consistent help so far, please give me some time to get the relevant information (I also need them thou..).

By the way, does anyone knows where can i get the "Win32 Multimedia API Documentation" ? Can't managed to find it in msdn..
 
Hi all,

Here are some updates regarding my current project. My final objective is to have a 6-channels voice activation recording. Meaning that the program will monitor these 6 channels and if it detects a Voice input, it'll start recording (this can happen simultaneously to six channels).

Now my problem..
1) Are there any sound cards available that's having six audio in? Or is there a way to configure such system?

2) Can MCI Command be programmed to trigger once Voice is detected from a source?

3) Anyone has any experience on how much is the size of WAV file recorded per minute? Does it varies much?

4) Can MCI Command be programmed to record audio in other formats? Like MP3?

I know there's quite a number of start-up questions here but i would very much appreciate and discuss this problem here. Thanks everyone especially bio4ema^^
 
hello again.

1.) you could use an audio interface like eg. :

this will be quite expensive though.

alternatively you could use a cheap external mixer and feed its ouput into a standard sound-card (cheaper, but less channel controll, poorer audio quality)

2.) i don't know if there is a specific command (i don't think so), you could write a function to monitor the input level (at a fairly high frequency) and start recording once the volume exceeds a certain level.

3.) depends on your format.
- cd quality (16 bit, 44100 hz, stereo) will need about 172 kb per second
- phone quality (8 bit, 11025 hz, mono) will need about 11 kb per second

of course there are other formats (what sound quality do you want to achieve ?)

4.) i don't think that you can use mci to record to an mp3-file but i'm not totally sure.

good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top