You can read some of the changes here: http://www.love2d.org/wiki/0.11.0
And about some of the audio stuff here: https://love2d.org/wiki/Effect_Constant ... Candidates
So here's some of the stuff I've been checking out...
You can now press Ctrl+C to copy error messages. Neat!
You can use QueueableSources to play sounds (from SoundData) seamlessly one after the other.
Code: Select all
function love.load()
sd1 = love.sound.newSoundData('1.mp3')
sd2 = love.sound.newSoundData('2.mp3')
sd3 = love.sound.newSoundData('3.mp3')
sd4 = love.sound.newSoundData('4.mp3')
qs = love.audio.newQueueableSource(sd1:getSampleRate(), sd1:getBitDepth(), sd1:getChannels())
qs:queue(sd1)
qs:queue(sd2)
qs:queue(sd3)
qs:queue(sd4)
love.audio.play(qs)
end
Code: Select all
function love.load()
rds = love.audio.getRecordingDevices()
rd = rds[1]
end
function love.keypressed()
if rd:isRecording() then
local sounddata = rd:getData()
rd:stop()
local source = love.audio.newSource(sounddata)
love.audio.play(source)
else
local sampleRate = 8000
local bitDepth = 16
local channels = 1
local samples = sampleRate * 2
rd:start(samples, sampleRate, bitDepth, channels)
end
end
function love.draw()
love.graphics.print(
'is recording: '..tostring(rd:isRecording())..'\n'..
'samples: '..rd:getSampleCount()..'\n\n'..
'sample rate: '..rd:getSampleRate()..'\n'..
'bit depth: '..rd:getBitDepth()..'\n'..
'channels: '..rd:getChannels()
)
end
Code: Select all
function love.load()
rds = love.audio.getRecordingDevices()
rd = rds[1]
qs = love.audio.newQueueableSource(rd:getSampleRate(), rd:getBitDepth(), rd:getChannels())
rd:start()
end
function love.update(dt)
if rd:getSampleCount() > 4000 then
qs:queue(rd:getData())
qs:play()
end
end
function love.draw()
love.graphics.print('sample count: '..rd:getSampleCount())
end
Code: Select all
function love.load()
love.keyboard.setKeyRepeat(true)
source = love.audio.newSource('loop.mp3', 'static')
source:setLooping(true)
love.audio.play(source)
highgain = 1
end
function love.keypressed(key)
if key == 'up' then
highgain = math.min(highgain + 0.01, 1)
elseif key == 'down' then
highgain = math.max(highgain - 0.01, 0)
end
source:setFilter({ type = "lowpass", highgain = highgain })
end
function love.draw()
love.graphics.print(highgain)
end