Next: , Previous: Soundfile Interaction, Up: Soundfile Interaction

4.2.1 sfplay

sfplay is a flexible command-line soundfile player that allows playback of multiple soundfiles in various formats with either real-time audio output or soundfile output. The following two example show two extremes of using of sfplay: simple playback of foo.wav and playing 3.2 seconds (-l) clips starting at 10.0 seconds (-s) into the file and repeating the clips for 2.5 times (-r) writing the output to output.wav (-f) at half volume (-g) playing each file in the collection Using the (–ws) option, you may manually set the window size in samples. The last command stores the MarSystem dataflow network used in sfplay as a plugin in playback.mpl. The plugin is essentially a textual description of the created network. Because MarSystems can be created at run-time the network can be loaded in a sfplugin which is a generic executable that flows audio data through any particular network. Running sfplugin -p playback.mpl bar.wav will play using the created plugin the file bar.wav. It is important to note that although both sfplay and sfplugin have the same behavior in this case they achieve it very different. The main difference is that in sfplay the network is created at compile time wheras in sfplugin the network is created at run time.

     sfplay foo.wav
     sfplay -s 10.0 -l 3.2 -r 2.5 -g 0.5 foo.wav -f output.wav
     sfplay -l 3.0
     sfplay foo.wav -p playback.mpl
     sfplugin -p playback.mpl bar.wav