How to play part of an audio in Love2D?

Viewed 87

Now this is my program at the moment and it plays the audio specified.

sound = love.audio.newSource('sound.wav',)
sound:play()

But what happens is it plays the whole audio whereas I want to only play part of it. Is there any way I can do that? Thanks in advance.

1 Answers

The best and simplest way to play a part of some audio file is to have that part in a separate audio file.

Otherwise you must use sound:stop() or sound:pause() depending on what you want. But then you have to care about proper timing.

https://love2d.org/wiki/love.audio

Related