Audio streaming

S

skt

Hi
Can anyone tell me how I can stream audio input from a microphone input
in C/C++? I would prefer plain C/C++, rather than DirectX/Windows
programming, though those would be fine too.
Also, how can i read/write wav files using file handles?

Thanks a lot
Srikanth
 
J

Jack Klein

Hi
Can anyone tell me how I can stream audio input from a microphone input
in C/C++? I would prefer plain C/C++, rather than DirectX/Windows
programming, though those would be fine too.

There is no such language as C/C++, there is C and another, different
language C++, similar in some ways to C.

There is no standard method in either C or C++ to access any hardware
device at all. All input and output is abstracted using C FILE *
streams or C++ streams.

Any access to hardware like a microphone would need to make use of
non-standard, platform specific extensions. You need to look on
http://msdn.microsoft.com, or ask in Windows specific groups like
or those in the
family.
Also, how can i read/write wav files using file handles?

There are no "file handles" in C or C++. There are FILE * streams or
C++ iostreams. You can use these to read and write wav files. I
suggest you make sure to open the files in binary mode.
 
B

Ben C

Hi
Can anyone tell me how I can stream audio input from a microphone input
in C/C++? I would prefer plain C/C++, rather than DirectX/Windows
programming, though those would be fine too.

It's not possible to actually get data from the microphone input without
using some OS specific APIs (i.e. something like DirectX/Windows
programming).

If you want to stream the data internally in your program because you're
processing it in some way (e.g. you're writing a mixer), then you can do
that in plain C or C++, probably by implementing some kind of "ring
buffer". But I'm not sure if that's really your question so I won't go
on.
Also, how can i read/write wav files using file handles?

You have to find a doc somewhere about wav file format and then
construct the header and write out the data as the format dictates. It's
quite simple to make an uncompressed wav file, so this is feasible. Or
of course find a lib etc. that can do it for you.
 
I

Ian Collins

Hi
Can anyone tell me how I can stream audio input from a microphone input
in C/C++? I would prefer plain C/C++, rather than DirectX/Windows
programming, though those would be fine too.

Looks like you'd be better of on a windows group, or one covering that
mythical language C/C++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top