PCM Encoder 0.01

by MSX Resource Center on 17-12-2011, 10:59

This tool allows you to encode samples for high quality playback on MSX, using 11, 22 and even 44kHz sample rates. Sources included.

AttachmentSizeDownloadsLast download
PCM Encoder82.83 KB47113 days 19 min ago

Comments

By ARTRAG

Enlighted (6862)

ARTRAG's picture

12-01-2022, 11:09

Note: the sample length to be passed to the player in the DE register is stored by the encoder in the first 2 bytes of the encoded data, thus the address of the encoded data to be passed in HL is two bytes later than the actual data start.
This is the player

;-------------------------------------
; Plays one sample
; IN   HL - Encoded sample start address
;      DE - Sample length (#pcm samples)
;-------------------------------------
PLAY_SAMPLE:

This is the snippet of how to call it

        ld  hl, SAMPLE_START + 2
        ld  de, (SAMPLE_START)
        call PLAY_SAMPLE
     
[...]

;-------------------------------------
; Sample data
;-------------------------------------
SAMPLE_START:
        incbin "sample.bin"
SAMPLE_END: