I was successfully able to output stereo audio from the C API using playdate->sound->addSource()
. Use of headphones confirms that both output channels are receiving distinct streams. However, when outputting exclusively to the right audio (writing zeroes to the left
buffer in the callback), it works on the headphones as expected, but the built-in speaker does not play any sound. It is, for all intents and purposes, an output for the left stream only.
A headphone connection can be polled through playdate->sound->getHeadphoneState()
, which can be used as a workaround to merge the stereo streams in software when sending to the speaker. It's a good idea in general to code distinct output profiles for both monaural and stereo. Nonetheless, having the streams automatically merged barring any other intervention would be appreciated--not to mention more accommodating to the broader developer scene.