class ZoomSample
- ZoomSample
- Reference
- Object
Defined in:
zoom_sample.crConstructors
Instance Method Summary
-
#parse
Unpack the four 8-bit samples into four 16-bit samples Per MAME documentation (src/devices/sound/zsg2.cpp):
- #tag : String
-
#to_pcm(filename)
Write a raw PCM audio file (no headers)
-
#to_wav(filename)
Write a PCM WAV file.
Constructor Detail
Instance Method Detail
def parse
#
Unpack the four 8-bit samples into four 16-bit samples Per MAME documentation (src/devices/sound/zsg2.cpp):
The samples are compressed with a 2:1 ratio. Each block of 4-bytes becomes 4 16-bits samples. Reading the 4 bytes as a little-endian 32bits values, the structure is:
42222222 51111111 60000000 ssss3333
's' is a 4-bit scale value. '0000000', '1111111', '2222222' and '6543333' are signed 7-bits values corresponding to the 4 samples. To compute the final 16bits value, left-align and shift right by s.