Get or set the
bits parameter (the sampling quality) of a Sample object or a wav file.
1 2 3
a Sample object, or a string giving the name of a wav file.
the number of bits per sample: 8, 16 or 24.
The replacement form can be used to reset the sampling quality of a Sample object, that is the number of bits per sample (8 or 16). Here, filenames are not accepted.
bits, the bits parameter (number of bits per sample) of the Sample object (8, 16 or 24).
setBits, a Sample object with the new
Changing the sampling quality of a Sample object does not affect its actual data but only its
$bits flag. The sampling quality is only used when a Sample object is played or saved to disk. Internally, R always uses doubles for the waveform.
An 8 bit sample needs only half the disk space compared to a 16 bit sample, but it has a lower sound quality.
Note also that 24 bit samples cannot be played by every wav file player.
1 2 3 4 5 6 7 8 9 10