mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Audio source decoding improvements.
- Streaming sources now also stream the file contents instead of loading it into memory, by default. Added a new stream type enum parameter to newSource ("file" or "memory").
- Audio file decoding now chooses the most appropriate decoder based on the file contents instead of the file extension.
- Videos now stream audio from the file instead of loading all of the video file into memory for use with audio decoding.
This commit is contained in:
@@ -33,7 +33,7 @@ function love.graphics.newVideo(file, settings)
|
||||
local source, success
|
||||
|
||||
if settings.audio ~= false and love.audio then
|
||||
success, source = pcall(love.audio.newSource, video:getStream():getFilename(), "stream")
|
||||
success, source = pcall(love.audio.newSource, video:getStream():getFilename(), "stream", "file")
|
||||
end
|
||||
if success then
|
||||
video:setSource(source)
|
||||
|
||||
Reference in New Issue
Block a user