Sound Player Parameters

The examples show examples of how to set player parameters in the test config file.

Sample rate

The sample rates available depends on the audio device that is used. For example, the analog devices in the O2 support all sample rates from 4kHz to 48kHz with 1Hz resolution. Digital ports only support 32/44.1/48 kHz.

Set sampling rate of the player by setting the rate parameter in the test config file. Example:

   # sampling rate of output
   player.rate=44100

The sample rate of the player and all the samples must be the same. If the sound player can use some sample rate, samples should be converted to a supported rate.

Channels

The maximum number of channels depends on the audio device that is used. Analog outputs usually support mono or stereo output. Digital outputs support up to 8 channels (depending on which digital port to use).

Set number of channels of the player by setting the channels parameter in the test config file. Example:

   # number of channels (1/2/4/8)
   player.channels=2

If a sample has more channels than there are output channels, extra samples are ignored.

Audio device

On some systems there are multiple independent audio ports. On a O2 with the digital audio option card there are four output devices: Analog Out, Analog Out 2, ADAT Out and AES Out. Different devices may have different choices of sample rates, number of channels, number of bits or output connections. Use 'apanel' or 'apanel -print' to list the choices of devices on your system. Also read the manuals.

Choices of devices for O2, Octane and Onyx2 systems include:

Analog Out and Analog Out 2
Analog stereo outputs, 16-bit on O2, 18-bit on Octane an Onyx2. Nearly arbitrary sample rates from 4kHz to 48kHz.
ADAT Out
8-channel, 24-bit ADAT Optical output. Sample rates: 32kHz, 44.1kHz, 48kHz.
AES Out
Stereo AES3 24-bit digital output. Sample rates: 32kHz, 44.1kHz, 48kHz.
in addition the device name default can be used that selects the default output device selected with apanel. However, you should not use the defaults device.

Set the device of the player by setting the device parameter in the test config file. Example:

   # set output device
   player.device=ADAT Out

You should use a device that is not the same as the default device. The audio output of tools and programs (includes bells from the console and shells and window manager, web browsers, etc.) goes to the default device if output device is not specially set (usually isn't).

Output volume

The output volume level offset or correction is used to set the output level. It can be used to adjust the volume of digital outputs (there is no level control for digital outputs as there are for analog outputs in apanel).

In earlier versions of the GuineaPig system the player's volume parameter was used to set the default listening level for the test (the MCL level). In current and future versions of the system use the MCLL-parameters in the test configuration file. Do not use the player's volume level for that purpose anymore.

Set the volume of the player by setting the volume parameter in the test config file. The volume level is in linear scale (usually between 0 and 1) or in decibel scale. Example:

   # set volume offset (linear scale, volume 50%)
   player.volume=0.5
This is equivalent to about:
   # set volume offset (linear scale, volume -6dB)
   player.volume=-6dB
Do not use levels more than 1 (linear scale) or positive decibel values, the output level may overflow with loud samples and cause distortions to audio.

Sound buffer length

The sound player mixes the output audio data in blocks (or buffer) of fixed size. The output is also double-buffered, the next block of data is calculated as the first is being written to the audio hardware. The buffering also means that an action (for example, the subject presses a button to play a sample) that is meant to take effect immediately will necessarily have a delay that roughly corresponds to two times the length of the buffer. The default buffer length is 4096 sample frames that will cause a delay of about 200ms (sample rate = 44.1kHz). It is possible to shorten the delay by shortening the buffer length. Shortening the buffer length reduces the delay but it also increases the risk of getting dropouts in sound if the buffer calculation didn't finish in time (other system activity and increased overhead caused by shorter blocks may cause problems, also audio files are loaded from disk on the fly).

The buffer length is set with the buflen parameter in the test config file. The length is in sample frames. The length of 44100 corresponds to one second with the sample rate of 44.1kHz. Example:

   # set mixing buffer length
   player.buflen=4096
Sets the buffer length to 4096 sample frames (roughly 93ms with sample rate 44.1kHz).

Note: If a command was scheduled beforehand to start at a certain point of time, no delay is observed (sub-millisecond accuracy).


· Sound Player index · Document index ·

Last modified: Sat Jul 18 18:27:46 EEST 1998