473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Audio streaming

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

Apr 10 '06 #1
3 6292
On 10 Apr 2006 10:19:03 -0700, sk*@xdtech.com 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
Apr 10 '06 #2
On 2006-04-10, sk*@xdtech.com <sk*@xdtech.com> 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.
Apr 10 '06 #3
sk*@xdtech.com 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.
Apr 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Daniel | last post by:
Hi all, I wanted a way to (http) stream Real Audio files without the need to use ..ram files. In case there are others interested in this, the following is the solution that worked for me: ...
4
by: Rajesh Kapur | last post by:
Hello All, We are building an application that will dynamically choose and pre-pend short underwriting messages to the audio streamed over the web. We will use SMIL files. We need to decide if...
3
by: DMS | last post by:
I need to create some specifications and budget request for a workstation (G5) and all necessary hardware and software for authoring online college courses. The course material would contain short...
1
by: JC | last post by:
Hi, I have to play a streaming audio. So in a thread I play audio as follow thread{ //some code for(;;){ //some code waveOutPrepareHeader(hwo, &(whdr), sizeof(WAVEHDR)); waveOutWrite(hwo,...
2
by: hzgt9b | last post by:
Using VS 2003, VB.NET and/or ASP.NET 2.0, BACKGROUND I have a window forms based application that contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowser) control. The TreeView is...
4
by: hzgt9b | last post by:
Using VS 2003, VB.NET and/or ASP.NET 2.0, BACKGROUND I have a window forms based application that contains a TreeView control and a WebBroswer (AxSHDocVw.AxWebBrowser) control. The TreeView is...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
8
by: Tony K | last post by:
Is streaming audio capable in asp.net 2.0 / AJAX? What I mean by streaming audio is: ability to play one or more songs back to back...or maybe even let the user select several songs to play and it...
2
by: cityrocker2005 | last post by:
Hi! Programmers, I have code for streaming audio file from remote server, if anybody know about it please send it to me.
0
MJMF
by: MJMF | last post by:
Streaming: how can i make an audio streaming to transmit the voice through a radio station to make the people listen by a web site. by C# please replay, help me MP3 audio effects: how can i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.