Write playdate.sound.sampleplayer sound to file

I've been working on a game that can record a sound, and I want to save that sound to disk.

Is there a way to do this?

Thanks in advance!

playdate.sound.sample:save(filename) may be what you're looking for ?

It would be if I was working with a sound from disk, but I'm creating a sound from scratch using playdate.sound.micinput.recordToSample.

Dang, I knew it was something stupid!

I was using sampleplayer instead of sample.