[SOLVED] How can i rewind a sound source, now that love.audio.rewind(source) has been removed?
Posted: Wed Aug 15, 2018 3:29 pm
Hi, tried searching, and fiddling about but cannot find a way to do this.
As per; https://love2d.org/wiki/love.audio.rewind (which is now removed since 11.0)
An example why i'd like to find a way to do this; a player can collect a series of pickups (coins, gems or whatever), which all use the same sound effect that could be an entire second long. But you may pickup/collide with many objects in a single second, and then things sound very spam-like and noisy as you have duplicate sources spamming away.
This is what i had used previously, only requiring a single source;
What i currently have as a temporary workaround (very spammy and noisy), and i believe :clone() makes many duplicates of the same source;
How can i recreate that previous behaviour without the love.audio.rewind() function?
As per; https://love2d.org/wiki/love.audio.rewind (which is now removed since 11.0)
An example why i'd like to find a way to do this; a player can collect a series of pickups (coins, gems or whatever), which all use the same sound effect that could be an entire second long. But you may pickup/collide with many objects in a single second, and then things sound very spam-like and noisy as you have duplicate sources spamming away.
This is what i had used previously, only requiring a single source;
Code: Select all
function sound:play(fx)
love.audio.rewind(fx)
fx:play()
end
Code: Select all
function sound:play(fx)
fx:clone():play()
end