Speed up .mp3 music in love

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
harrison
Prole
Posts: 17
Joined: Tue Feb 03, 2015 5:24 am

Speed up .mp3 music in love

Post by harrison »

I need to somehow tell my background music to speed up during execution. Is there a way to tell the engine to "play this .mp3 file at 1.34 times speed"?

If I can't figure this out I will have to reprogram my game with a different game engine :death:


relevant thread from 2014 where people said it was impossible (unresolved):
https://love2d.org/forums/viewtopic.php?t=78131
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Speed up .mp3 music in love

Post by raidho36 »

You just set pitch to higher value. That's it.

Try browsing the manual. That's a sure way to know all relevant features.
User avatar
harrison
Prole
Posts: 17
Joined: Tue Feb 03, 2015 5:24 am

Re: Speed up .mp3 music in love

Post by harrison »

But if I set the pitch to be higher, it will make my music all squeaky, won't it? Sorry if I have an incorrect understanding of pitch, I don't know much about music.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Speed up .mp3 music in love

Post by raidho36 »

Well yeah if you increase pitch both playback speed and frequency increase. It's impossible to make it play faster or slower without both pitch change and audible glitches, it's either one or the other.
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

Re: Speed up .mp3 music in love

Post by Santos »

I think what you're looking for is time stretching. LOVE doesn't do this currently unfortunately. :( I wonder if it's possible or likely in the future? Maybe one of the devs could say.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Speed up .mp3 music in love

Post by zorg »

Santos wrote: Wed Aug 02, 2017 5:49 am I think what you're looking for is time stretching. LOVE doesn't do this currently unfortunately. :( I wonder if it's possible or likely in the future? Maybe one of the devs could say.
I'm not a dev but i'll say that it's highly unlikely for it to ever be supported. (as someting inbuilt)

Also good luck finding a game engine that does this kind of thing, without external plugins; this is hard to code.

That said, it's possible to implement even with löve (0.11 that is), since the time domain, or the frame-based approach from the above wikipedia article may be fast enough and not too demanding for it to run at acceptable speeds.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 189 guests