love-microphone icon indicating copy to clipboard operation
love-microphone copied to clipboard

How do I record /stream an audio recording?

Open limenleap opened this issue 7 years ago • 1 comments

Hi I am new to Lua and Love2D ... but I got your sample working on Windows 10

Can you please show me how to save the audio captured from the microphone to a file? Or how can I stream the audio onto the Internet

Thanks a lot!

limenleap avatar Dec 30 '17 17:12 limenleap

The object given to you from the setDataCallback method is an instance of LOVE's SoundData object. You can use the getPointer and getString methods to turn it into something that you can send over the internet as raw data!

I don't think that LOVE includes any way to save audio to a file right now. If you want to go down that route yourself, you just have to figure out how to turn PCM (the kind of audio representation SoundData uses) into the file format you want to save as. Some formats are basically just a little bit of header data followed by PCM, so that could be really easy!

LPGhatguy avatar Dec 30 '17 22:12 LPGhatguy