Skip to content

fix: ogg decoding example with stereo#74

Open
pjsph wants to merge 1 commit intodevkitPro:masterfrom
pjsph:fix/ogg-stereo-decoding
Open

fix: ogg decoding example with stereo#74
pjsph wants to merge 1 commit intodevkitPro:masterfrom
pjsph:fix/ogg-stereo-decoding

Conversation

@pjsph
Copy link
Copy Markdown

@pjsph pjsph commented Apr 22, 2026

The example was only working with mono audio files, despite the visible effort to make it work with both mono and stereo.

Field nsamples of a ndspWaveBuf actually represents the number of samples for one channel (as in L/R channels) only. When reading a stereo file, previous code was telling the dsp that it had to read twice more samples than were stored in the buffer, which resulted in audio being chopped (played for 120ms, the length of the buffer, then cut for 120ms), and surely a UB

@pjsph pjsph force-pushed the fix/ogg-stereo-decoding branch from 8666c91 to 74d8ffc Compare April 22, 2026 17:02
@pjsph pjsph marked this pull request as ready for review April 22, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant