Vsound is a digital recording application for Linux/Unix systems that captures audio output from other programs like RealPlayer.
Vsound uses a unique technique to carry out its work. Linux and other unix-like systems allow for the overriding of functions in a shared library without having to replace the entire library. This is done by creating a new shared library that contains the definitions of the functions you want to override. Additionally, by using the dlsym() function, you can still call the original function by using a function pointer.
In the case of Vsound, the functions that need to be overridden are open(), ioctl(), write(), and close(). By overriding these functions, Vsound can detect all attempts to open the /dev/dsp device. From there, all ioctl() calls on this device are recorded to a file which can later be used to determine the data format of the file being played. Additionally, the standard write() function is also overridden so that all audio data written to the audio device is also written to a temporary file. Similarly, the close() function is overridden so that Vsound knows when to close the file containing the captured audio data.
The functions needed to override are gathered together in a shared library called libvsound.so. The other part of the Vsound system is a shell script called vsound. This shell script uses the LD_PRELOAD variable to preload libvsound.so and then run the target program with all its command line arguments. When the target program terminates, the vsound shell script uses SoX to convert the AU format file into a WAV file named vsound.wav in the current directory.
The latest update to Vsound includes some important features. The autostop patch by Richard Taylor has been rolled in, which kills the player after a set number of seconds of inactivity (defined as the time that the /dev/dsp device is closed). The --autostop (-a) autostop option handling from above patch has also been added, and the non-functional --resample (-r) option has been fixed. Overall, Vsound is a valuable tool for Linux/Unix users looking to digitally record the output of another program.
Version 0.6: N/A