love-microphone
love-microphone copied to clipboard
How do I record /stream an audio recording?
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!
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!