Otiose Liv - Otiose Products, Unreal Subtraction - The futile X of our dimensions

16bit WAV Network Audio Streamer (Server/Client)

For one of my course projects, I decided to make a network audio streaming server & client. Tired of low quality voice-chat, I decided to make something which delivers a lot better quality – i.e. 2ch 16bit wav. Obviously, this needs very high network bandwidth (~170KB/s per client).

For portability, I made it cross platform, and have tested it on Windows XP, Mac OSX, and Ubuntu 9.04. Some of the debugging text seems to be a bit buggy, but it otherwise works. It’s just a stand-alone commandline executable, so you’ll have to run it from the command prompt. (I can’t be bothered to build 3 different GUI front-ends for the different OSes, even though GTK is an option)

I’m not currently posting the source code, and I don’t currently have access to my Ubuntu installation & binary executable, so all I’m posting for now is the Win32 & Mac OSX binaries.

Download:
audiostreamer.zip [610KB, Win32]
audiostreamer.tar.gz [37KB, Mac OSX 10.5+]

Here is the commandline usage:

usage:     audiostreamer.exe <type> <port> <hostname>
<type>     specifies whether we are running as a server or client
           Values: 's' (server) or 'c' (client)
<port>     specifies the host/port to listen on (as server) or to
           connect to (as client)
<hostname> specifies the host to connect to (as client). No effect
           as server

I made use of portaudio, libpthread (win32) for this project.

Audiostreamer will use your default input (For win32 – I haven’t implemented ASIO support yet, so it uses your WAVE input. For Mac OS, it should take your default CoreAudio input – I haven’t actually tested audio input on Mac OS)

Audio is streamed through the TCP port of your choosing. You NEED a fast network connection for this, or you may experience buffer underruns. Make sure you forward your port if needed (through your firewall/router)


4 Responses to “16bit WAV Network Audio Streamer (Server/Client)”


  1. Sam Says:

    Nice one mate, works perfectly, Are you still working on this project? I would love to be able to select sound cards.

  2. Sam Says:

    Actually no, its not prefect. Using the windows version the server crashes after an hour or so.

    Using windows batch I wrap the RX side in this batch

    @echo off

    echo ///Streaming PCM 16 bit Audio.

    set server_url=192.168.88.68
    set port=12000

    :start
    title Receiving from %server_url%

    echo.
    echo -------------------------------------------------------------------------------
    audiostreamer.exe c %port% %server_url%
    echo -------------------------------------------------------------------------------

    ping -n 1 %server_url% >nul

    goto :start

    and the TX side in this batch

    @echo off

    echo ///Streaming PCM Audio.
    set port=12000

    :start
    title ///Streaming PCM Audio.

    echo.
    echo -------------------------------------------------------------------------------
    audiostreamer.exe s %port%
    echo -------------------------------------------------------------------------------

    ping -n 3 %server_url% > nul

    goto start

  3. Hoong Ern Says:

    Hi Sam, I sent you an email. Repeated here:

    I actually did this project in a rush, it was a final project for one of my classes, so indeed there may be bugs (I'm not even convinced myself whether it works that well). What version of Windows are you running? Does the server crash all the time you run it? i.e. - is the crash replicable? Just confirming, you're running 1 server and 1 client instance? Does it crash if you run it purely on localhost (127.0.0.1)? I'll run some tests on my side and see what I can do.

    As for choosing multiple soundcards, I'll see what I can do. It's actually not that hard to implement. But I guess it's not that useful to have that option if it's crashing anyway, so I'll try to look at that first.

  4. Sam Says:

    Dear Hoong,

    Thank you for your reply. I have been running the app for a few hours today across my wireless network with out any problems, So I'm not sure what was the cause of the crashes as I'm using exactly the same configuration as before, Windows XP 64 → Wifi-> Windows XP 32.

    Regards
    Sam

Leave a Reply