📜  播放声音 love2d - Lua 代码示例

📅  最后修改于: 2022-03-11 14:54:54.451000             🧑  作者: Mango

代码示例1
sound = love.audio.newSource("pling.wav", "static") -- the "static" is better for short sound effects (load the file into memory)
music = love.audio.newSource("techno.ogg", "stream") -- the "stream" is better for longer music tracks (stream the file from disk)

sound:play()
music:play()

music:setVolume(0.6) -- 90% of ordinary volume
sound:setPitch(0.1) -- one octave lower