🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Carl Danley Mon, 30 Jun 2008 16:52
waveIn/waveOut API
#168
Author: Carl Danley
Date: Mon, 30 Jun 2008 16:52
2 lines
1106 bytes
Anyone able to write me some sample coding for creating a stream to record 
audio to using the waveIn, waveOut API? 
Re: waveIn/waveOut API
#170
Author: Bob Gonder
Date: Mon, 30 Jun 2008 18:34
9 lines
1150 bytes
Carl Danley wrote:

>Anyone able to write me some sample coding for creating a stream to record 
>audio to using the waveIn, waveOut API? 

Since you want to forward the "stream" over TCP/IP,
I think simple buffered read/writes would be simpler.
I have outlined the documentation and general
overview in the sockets group.
Re: waveIn/waveOut API
#171
Author: Jason Cipriani
Date: Mon, 30 Jun 2008 20:25
35 lines
2748 bytes
"Carl Danley" <cdanley@codebyter.com> wrote in message 
news:48690f45$1@newsgroups.borland.com...
> Anyone able to write me some sample coding for creating a stream to record 
> audio to using the waveIn, waveOut API?

You'll be using the waveIn* functions to open and read from an audio input 
device. The waveOut functions are for writing sounds to audio hardware, not 
for writing WAV files.

Start with waveInOpen:
http://msdn.microsoft.com/en-us/library/ms713735(VS.85).aspx

I don't know what you are recording audio -to-, so I'm assuming to disk. As 
you capture samples, it's straightforward just to write to WAV files 
directly with stdio or iostreams or whatever your preferred API is. Here is 
the WAV file format, they are much easier to write than they are to read::
http://ccrma.stanford.edu/courses/422/projects/WaveFormat/

You only need to write the "data" and "fmt " subchunks. Just write the 
header with the appropriate values then write all the samples, nothing to 
it.

You could also consider using DirectSound, or DirectShow. It's trivial with 
both, assuming familiarity with DirectX and COM. I believe there is a sample 
class CWaveFile that comes with DirectSound that can also handle writing WAV 
files:
http://msdn.microsoft.com/en-us/library/bb206370(VS.85).aspx

See the TOC on the left of that link for more DirectSound links. One 
advantage of DirectSound, or DirectShow, is that it becomes extremely easy 
to use other codecs, such as MP3, to record audio, and also to use files on 
disk as well as hardware as audio sources (or any source with a DirectSound 
driver) without modifying much application code.

Jason
Re: waveIn/waveOut API
#172
Author: Jason Cipriani
Date: Mon, 30 Jun 2008 20:27
15 lines
1543 bytes
"Jason Cipriani" <jason.cipriani@nospam-gmail.com> wrote in message 
news:48694148$1@newsgroups.borland.com...
> "Carl Danley" <cdanley@codebyter.com> wrote in message 
> news:48690f45$1@newsgroups.borland.com...
>> Anyone able to write me some sample coding for creating a stream to 
>> record audio to using the waveIn, waveOut API?

Oh yeah, I forgot, you may also want to consider AudioLab:

http://www.mitov.com/html/audiolab.html

It's free, incredibly powerful and easy to use, and contains VCL components 
for handling all this kind of stuff for you.

Jason
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads