![]() ![]() |
Inferno Audio Device |
Inferno fully implements audio on the Windows 95/NT and Solaris platforms.
Other platforms will be supported in the near future.
You can use the Inferno Audio device to:
- Use a microphone attached to your computer to hear the sound through your speakers or save the sound in a file
- Use a microphone attached to one computer to hear the sound through speakers on a machine across the network
- Play a sound file (such as .WAV or .SND files on Windows 95/NT)
Playing a sound file from the Emu control console
The basic way to hear a sound file is to use the following commands from the Emu control console:
bind -a '#A' /dev cat soundfile > /dev/audioThe first command binds the audio device, #A, to the device directory, by convention /dev. The second command directs the sound file through the audio device, /dev/audio.
The soundfile can be a .WAV or .SND file The Inferno Audio device uses the format and attributes specified in the audioctl file. This control file is in the directory where the Audio device is bound; by convention, /dev, as in the bind command above. For more information, see audio - interface to audio device in the Inferno Reference Manual.
To view the current settings in the control file, enter the following from the Emu control console prompt (using the /dev convention):
cat /dev/audioctlThe default control file is:
indev mic line outdev spkr hdph line enc pcm ulaw alaw rate 8000 11025 22050 44100 bits 16 8 chans 2 1 left 100 0 100 right 100 0 100 buf 100 0 100 count 0Each line represents an individual characteristic and all possible values. The second field in each line is the current setting.
To change a setting to match a particular sound file (the launch.wav file uses the defaults), you use the echo command. For example, to change the sample rate, enter the following at the control console prompt:
echo rate=11025 > /dev/audioctlPlaying a sound file from within Limbo programs
Below are links to three Limbo files that demonstrate programming for the Inferno audio device. Click on the link and then use your browser's Save As... option to save the file to an Inferno directory, such as <inferno_root>/usr/inferno.
To compile these into executable .dis files, use the Limbo compiler. For example, to compile play.b, enter the following command at the control console prompt:
limbo play.bYou can experiment with these Limbo modules and recompile them to learn more about programming for the Inferno audio device.