From 9b87589f7b8501904f1cab4e8b506e3d6430e51f Mon Sep 17 00:00:00 2001 From: "5684185+vsariola@users.noreply.github.com" <5684185+vsariola@users.noreply.github.com> Date: Wed, 12 Nov 2025 13:44:49 +0200 Subject: [PATCH] docs(examples/code/C): add comment showing how to loop the song Closes #216 --- examples/code/C/cplay.windows.winmm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/code/C/cplay.windows.winmm.c b/examples/code/C/cplay.windows.winmm.c index 834e756..3916297 100644 --- a/examples/code/C/cplay.windows.winmm.c +++ b/examples/code/C/cplay.windows.winmm.c @@ -22,6 +22,11 @@ WAVEFORMATEX wave_format = { SU_SAMPLE_SIZE*8, 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 = { (LPSTR)sound_buffer, SU_LENGTH_IN_SAMPLES * SU_SAMPLE_SIZE * SU_CHANNEL_COUNT,