1 VSOUND - a virtual audio loopback cable 2 3This program allows you to record the output of any standard OSS 4program (one that uses /dev/dsp for sound) without having to modify or 5recompile the program. It uses the same idea as the esddsp wrapper 6from the Enlightened Sound Daemon (in fact, vsound is based on 7esddsp). That is, it preloads a library that intercepts calls to open 8/dev/dsp, and instead returns a handle to a normal file. It also 9intercepts ioctl's on that file handle and logs them, to help convert 10the audio data from its raw form. Vsound then uses sox to convert the 11raw data to the desired file format. 12 13The upshoot of this is that instead of playing sound to the sound card 14in your computer, the data is recorded to a file. This is similar to 15if you connected a loopback cable to the line in and line out jacks on 16your sound card, but no DA or AD conversions take place, so quality is 17not lost. 18 19One use of vsound is to help convert real audio files to some other 20format. Since the real audio format is proprietary, and all we have 21is a player, we can use the vsound to create a wave file like so: 22 23 vsound -f output.wav realplay input.rm 24 25This will run realplayer under vsound. You will notice that no sound 26is produced while the real audio file is being played. When the file 27has completed playing, exit realplayer, and the raw audio data will be 28converted to a wave file. 29 30With the help of some other encoder, you would then be able to convert 31the wave file to MP3 if you wanted. This method is probably the one 32that preserves the most data during the conversion. 33 34There are probably many other possible uses for vsound. Just use your 35imagination. 36 37A patch by Richard Taylor added an autostop switch to vsound allowing 38it to stop recording automatically when /dev/dsp is closed, ideal for 39use with RealPlayer for recording BBC radio programmes (a very 40popular use for vsound). 41 42Description from Richard; 43 "I use vsound to record programmes from the BBC to listen to in my 44 car on the way to work. One of things that I have found annoying is 45 having to find out the length of the programme before I can set up 46 my record script to kill realplayer when the programme has finished. 47 48 I noticed that realplayer closes the /dev/dsp handle once a 49 programme has finished. So I have patched vsound to add a new flag 50 '-a' which will kill the player after a set number of seconds of 51 inactivity (defined as the time that the /dev/dsp device is closed). 52 53 54If you have bug reports (or even better, bug fixes!) or ideas for 55improvements then please email me. 56 57Nathan Chantrell <nsc@zorg.org> 58