1) PulseAudio
We can define an existing AirTunes device (e.g. Airport Express) as an output audio sink for Pulse Audio by installing paprefs and pulseaudio-module-raop and running Pulseaudio Preferences:
In the first tab Network Access tick "Make discoverable Apple AirTunes sound devices available locally".
As soon as the device is registered in the local network we can switch to this device from Sound Settings:
Choose the name you have registered your AirTunes device (e.g. "Wohnzimmer" in this example). Note that we can not switch the output while a media player is streaming to our soundcard. Pause or stop your player before changing output sinks. Streams will have a delay of about 3 to 4 seconds.
The vlc media player claims to be able to stream audio via the RAOP protocol directly to an AirTunes device. However so far I was unable to achieve this with VLC 2.0 so I can't give you directions here.
After downloading and installing the DEBIAN package for stream2ip the application needs to be set up for streaming to the Air Tunes device by running Preferences from the man window:
Select the device Airport Express and type in the IP (the port is optional) of the device. By choosing Autoconnect and a time interval >0 seconds the application will listen for the AirTunes device on the given IP to connect as soon as the device is ready:
The advantages of stream2ip over simply using Pulseaudio Sound Settings are:
- Wait for a device to connect as soon as it is present.
- Re-establish an interrupted connection.
- No need to stop playback of a running media player to connect.
- Restore previous output when the external device is turned off
I would suggest you use a streaming server application.
There is ampache
(amarok, andriod client, ..), which is a PHP + Mysql webstreaming application.
http://ampache.org/wiki/clients:amarok
and there is the Firefly Mediaserver
http://www.fireflymediaserver.org/
Firefly has also the support to stream to iTunes and lots of other applications including Rhythmbox.
I would suggest the Firefly
because it is a little bit easier to setup.
Best Answer
Yes, with pulseaudio this can easily be done. You will need to install and run paprefs that makes your sound devices available over the network.
These settings allow both sound sources and sinks to be published over the network, ideally to another pulseaudio server.
In case you have your server setup without desktop manager you will need to install a sound system first (see this question). You can then edit
/etc/pulse/default.pa
uncommenting these lines in the Network access section:If you want to use RTP sender uncomment these lines the RTP sender module section:
The pulseaudio server needs to be started as a daemon with
pulseaudio -D
in case it's not yet running. For optimizing sound qualitity settings in the/etc/pulse/daemon.conf
may be adapted to personal needs.An alternative method to stream audio in your network would be to setup an Icecast Server (see this question).