Add details on constant values for ADPCM sample formats

In the docs for playdate.sound.sample:getFormat() (Inside Playdate), there are four possible constants listed:

  • playdate.sound.kFormat8bitMono
  • playdate.sound.kFormat8bitStereo
  • playdate.sound.kFormat16bitMono
  • playdate.sound.kFormat16bitStereo

@jaames tipped me that there are two more possible values:

  • 4 for mono ADPCM
  • 5 for stereo ADPCM

Are there any corresponding constants for these two values? It'd be great to have this documented.

1 Like

Those are the only others I see in the source code, and they're documented in Inside Playdate with C, but I'll have to ask why they aren't exposed in the Lua API. Most likely an accidental omission. Thanks for bringing it to our attention.

1 Like

Thank you! Checking the C documentation haven't even crossed my mind. Though it doesn't seem like the variables playdate.sound.kFormatADPCMMono or playdate.sound.kFormatADPCMStereo exist. Maybe they're not exposed in the Lua SDK?

Yeah, there's just no Lua equivalent for the C constants. I've filed a request to add them in a future SDK update. Sorry about that!

1 Like