docs(examples/code/C): add comment showing how to loop the song

Closes #216
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2025-11-12 13:44:49 +02:00
parent 16c652b2ba
commit 9b87589f7b

View File

@ -22,6 +22,11 @@ WAVEFORMATEX wave_format = {
SU_SAMPLE_SIZE*8, SU_SAMPLE_SIZE*8,
0 0
}; };
// If you want to loop the song:
// 1) Change WHDR_PREPARED -> WHDR_BEGINLOOP | WHDR_ENDLOOP | WHDR_PREPARED
// 2) The next field should then contain the number of loops (for example, 4)
// 3) Remember also change the exit condition for main, e.g. if you plan to loop 4 times:
// mmtime.u.sample != SU_LENGTH_IN_SAMPLES -> mmtime.u.sample != 4 * SU_LENGTH_IN_SAMPLES
WAVEHDR wave_header = { WAVEHDR wave_header = {
(LPSTR)sound_buffer, (LPSTR)sound_buffer,
SU_LENGTH_IN_SAMPLES * SU_SAMPLE_SIZE * SU_CHANNEL_COUNT, SU_LENGTH_IN_SAMPLES * SU_SAMPLE_SIZE * SU_CHANNEL_COUNT,