Audio streaming

Discussion in 'C Programming' started by skt@xdtech.com, Apr 10, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Jack Klein Guest

    On 10 Apr 2006 10:19:03 -0700, 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/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Apr 10, 2006
    #2
    1. Advertising

  3. Ben C Guest

    On 2006-04-10, <> 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.
     
    Ben C, Apr 10, 2006
    #3
  4. Ian Collins Guest

    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.
     
    Ian Collins, Apr 11, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raed Sawalha
    Replies:
    0
    Views:
    351
    Raed Sawalha
    Oct 7, 2004
  2. tshad

    Streaming audio/video

    tshad, Nov 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    358
    tshad
    Nov 16, 2005
  3. Ravi Kosuri
    Replies:
    0
    Views:
    472
    Ravi Kosuri
    Aug 4, 2003
  4. Bill French

    streaming audio using java

    Bill French, Mar 4, 2004, in forum: Java
    Replies:
    0
    Views:
    522
    Bill French
    Mar 4, 2004
  5. Bill French

    streaming audio & java

    Bill French, Mar 4, 2004, in forum: Java
    Replies:
    0
    Views:
    637
    Bill French
    Mar 4, 2004
Loading...

Share This Page