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!
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!
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
.
In what way does the your code not work as expected?
How does it differ from the below (untested code)
local secondsToRecord = 7
local buffer = playdate.sound.sample.new(secondsToRecord, playdate.sound.kFormat16bitMono)
function saveRecording(sample)
sample:save("file.wav")
end
playdate.sound.micinput.recordToSample(buffer, saveRecording)
Dang, I knew it was something stupid!
I was using sampleplayer
instead of sample
.