Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Audio streaming

Reply
Thread Tools

Audio streaming

 
 
skt@xdtech.com
Guest
Posts: n/a
 
      04-10-2006
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

 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      04-10-2006
On 10 Apr 2006 10:19:03 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote in comp.lang.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.


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
news:comp.os.ms-windows.programmer.win32 or those in the
news:microsoft.public.* 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.

> Thanks a lot
> Srikanth


--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
 
Reply With Quote
 
 
 
 
Ben C
Guest
Posts: n/a
 
      04-10-2006
On 2006-04-10, (E-Mail Removed) <(E-Mail Removed)> wrote:
> 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.
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      04-11-2006
(E-Mail Removed) wrote:
> 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++.

--
Ian Collins.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
drop off when using streaming audio with linksys router Ron Wireless Networking 0 02-17-2006 04:16 AM
Streaming Audio/Video Crashes DSL/Cable Connection Guy Quinn Wireless Networking 0 12-31-2005 09:12 PM
Re: Streaming Audio Problem news_naught Firefox 0 07-27-2003 02:24 AM
Re: Streaming Audio Problem Irmen de Jong Firefox 1 07-17-2003 08:01 PM



Advertisments