Chip8Java icon indicating copy to clipboard operation
Chip8Java copied to clipboard

Add Audio Playback Operation

Open craigthomas opened this issue 1 year ago • 0 comments

The XO Chip specification states that a new 16-byte pattern buffer should be generated to hold digital samples for playback. This internal buffer is set using the audio operation with opcode F002. The function reads 16 bytes starting from memory address pointed to by the index register into the 16-byte internal pattern buffer. When the sound timer is non-zero, the 16-byte pattern buffer is played back at a frequency that depends on the pitch register. The playback frequency of the sample is determined by the following equation:

4000 * 2^((pitch - 64) / 48)

The audio pattern is played at the specified frequency (in Hz) until the sound timer reaches (or is set to) 0. The pattern remains in the internal pattern buffer until a subsequent audio operation replaces the pattern in the buffer. The pattern buffer is initialized to be all zeros.

craigthomas avatar Sep 02 '24 14:09 craigthomas