Search found 5 matches

by Intas
Sat Jan 05, 2019 5:54 pm
Forum: Support and Development
Topic: unable to move image
Replies: 2
Views: 2451

Re: unable to move image

The problem is that in love.update almost all of your ifs are nested, which is probably not what you want. It's a common mistake, I did it too. Just remember the old saying in Lua . Here's how your code looks like if we put tabs after an if: function love.load() DtimePassed = 0 AtimePassed = 0 right...
by Intas
Fri Jan 04, 2019 4:52 am
Forum: Support and Development
Topic: [Solved] Is there any way to save sounddata to a file?
Replies: 7
Views: 6510

Re: Is there any way to save sounddata to a file?

Since i'm guessing write_samples_interlaced wants a lua table of values, you need to fill a table with the samplepoints you can get from the sounddata with the :getSample method (indexed from 0 to sounddata:getSampleCount-1), then, since that method returns values in the range of [-1.0,1.0], you ne...
by Intas
Wed Jan 02, 2019 12:04 am
Forum: Support and Development
Topic: [Solved] Is there any way to save sounddata to a file?
Replies: 7
Views: 6510

Re: Is there any way to save sounddata to a file?

Okay, so I found this which seems to be what I want. It's made in pure lua so I have to change lua's IO with love.filesystem. require("wav") -- ... local samples = {} local sounddata = rd:getData() rd:stop() local source = love.audio.newSource(sounddata) love.audio.play(source) -- Play wha...
by Intas
Sun Dec 30, 2018 9:40 pm
Forum: Support and Development
Topic: [Solved] Is there any way to save sounddata to a file?
Replies: 7
Views: 6510

Re: Is there any way to save sounddata to a file?

Hey zorg, thanks for replying! you could write out a wav header and then the data using the correct format, which would be the simplest format to do, in my opinion. Could you point me in the right direction on how could I do this? Is it something I should do using ffi? I'm completely unfamiliar with...
by Intas
Sat Dec 29, 2018 10:13 pm
Forum: Support and Development
Topic: [Solved] Is there any way to save sounddata to a file?
Replies: 7
Views: 6510

[Solved] Is there any way to save sounddata to a file?

Hello. With the microphone recording thing you can get the sounddata using RecordingDevice:getData() and with that you can create a source using love.audio.newSource(). Now I'd like to know if is possible to store that sounddata into a file (.wav? .mp3?) so I can play anytime whatever the microphone...