SDL_HINT_WAVE_TRUNCATION(3)

πŸ’– SDL_HINT_WAVE_TRUNCATION πŸ’–

okay bestie, welcome to the manual page for SDL_HINT_WAVE_TRUNCATION β€” it lives in the SDL3 FUNCTIONS fam and it's literally here to decide what happens when your WAVE file is giving... incomplete. πŸŽ€


✨ NAME ✨

SDL_HINT_WAVE_TRUNCATION β€” a variable controlling how a truncated WAVE file is handled. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION"

like. that's it. that's the whole vibe. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so a WAVE file is considered truncated if any of the chunks are incomplete or if the data chunk size is not a multiple of the block size. 😭

by default, SDL decodes until the first incomplete block, because that's what most applications seem to do. no cap, that's just the normie behaviour. 🫢

the variable can be set to the following values:

  • "verystrict" β€” raise an error if the file is truncated. like, full drama, we're not doing this. πŸ’€
  • "strict" β€” like "verystrict", but the size of the RIFF chunk is ignored. πŸ™ˆ
  • "dropframe" β€” decode until the first incomplete sample frame. ✨
  • "dropblock" β€” decode until the first incomplete block. this one is the default, bestie. ⭐
🚨 IMPORTANT: this hint should be set before calling SDL_LoadWAV() or SDL_LoadWAV_IO(). set it after and it's giving... nothing. 😭

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. she's new-ish, she's iconic, she ate. πŸ‘‘


that's the whole page, bestie!! stay slay, keep your chunks complete, and remember β€” this was brought to you by Simple Directmedia Layer, SDL 3.4.18, mwah πŸ’–πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from