I'm experiencing a weird problem with the audio module of LÖVE. No matter what song I play--regardless of its format--is played in a very glitchy manner (the song stutters and sounds very robotic). LÖVE's memory usage also skyrockets and the program ends up crashing from using up too much memory.
I've tested this on both versions 0.8.0 and 0.9.0 (both clean installs). In one test case I installed LÖVE and in the other I just used the zipped version, but the issue still persists. I have no idea what could be causing this and I'm at a loss. Is there some kind of issue I'm not seeing?
Audio glitchy and memory leak?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Audio glitchy and memory leak?
What's the code you're using to test?
-
- Prole
- Posts: 2
- Joined: Sat Dec 28, 2013 12:08 pm
Re: Audio glitchy and memory leak?
It looks like I done goofed. It just hit me why it's happening:slime wrote:What's the code you're using to test?
Code: Select all
-- The code I was using.
function love.draw()
s = love.audio.newSource("test.mp3")
s:play()
end
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Audio glitchy and memory leak?
The Source:play() call isn't what's causing the memory issues (although it's generally good to avoid calling that when you don't actually want a Source to start playing.) It's the love.audio.newSource call, which loads a completely unique new Source every time it's called.
- qubodup
- Inner party member
- Posts: 775
- Joined: Sat Jun 21, 2008 9:21 pm
- Location: Berlin, Germany
- Contact:
Re: Audio glitchy and memory leak?
Clarification: put the love.audio.newSource() line into love.load(). love.draw() gets executed all the time.slime wrote:The Source:play() call isn't what's causing the memory issues (although it's generally good to avoid calling that when you don't actually want a Source to start playing.) It's the love.audio.newSource call, which loads a completely unique new Source every time it's called.
Actually you might want to put the :play() line into love.load() for testing as well, unless you want it to repeat all the time.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Audio glitchy and memory leak?
If you want it to repeat then you should call Source:setLooping(true) once, and call Source:play() when you want it to start the first time (or if it's paused or stopped at some point and you want to unpause or restart.)qubodup wrote:Actually you might want to put the :play() line into love.load() for testing as well, unless you want it to repeat all the time.
Think of it like music player GUI controls, you click a repeat button and click play, and leave it until you want to change things.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Audio glitchy and memory leak?
You don't mash the play button?
Who is online
Users browsing this forum: No registered users and 8 guests