Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to timestretch audio, keeping it smooth(er) when running slowly #8717

Closed
wants to merge 13 commits into from

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented May 1, 2016

Simply grabbed the timestretcher that Citra are using now, and integrated it in a hacky way.

TODO: Make it an option, make it more stable (it's quite "drifty"), make it smarter when ratio changes very quickly like during a load or sudden slowdown.

Alternatively, try to implement a different algorithm. The interface to Soundtouch is not really what we want - I want to be able to say "I gave you these samples, now I want this other number of samples to fill the gap" and it should give it to me, instead I need to dynamically adjust the ratio. Maybe that's equivalent though...

@@ -0,0 +1,29 @@
#pragma once
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is but I think you don't want it.

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. Force-pushed it away now.

@hrydgard hrydgard force-pushed the timestretch-audio branch 2 times, most recently from cecaf55 to 177f9cc Compare May 1, 2016 16:54
@daniel229
Copy link
Collaborator

Crash on reopen game.

@finansar222
Copy link

เล่นเกมติดขัด และเสียงแตก

@zminhquanz
Copy link
Contributor

Please update this in next version ( 1.4.0) , to improve game experience when emulator speed is slow on older device

@hrydgard hrydgard added this to the v1.4.0 milestone Dec 6, 2016
@zminhquanz
Copy link
Contributor

please merge and approve this 👍

@hrydgard
Copy link
Owner Author

I think I'm gonna make it an option. It has some drawbacks (worse latency, etc).

@zminhquanz
Copy link
Contributor

I think so :)

@hrydgard
Copy link
Owner Author

Rebased.

@iOS4all
Copy link

iOS4all commented Feb 21, 2017

@hrydgard when you'll merge this please? Maybe it could help somehow.
And yeah it's better to make this merge like an option to avoid some issues maybe. I mean if you feel you need it you have to enable it. If you don't just disable it.
Thanks.

@hrydgard
Copy link
Owner Author

So, this does not work fantastically well yet, but I'll merge soon anyway so people can play around with it.

It's not very quick at adapting to changing rates, not sure what I'm doing differently to what Citra is.

@hrydgard hrydgard changed the title WIP: Timestretch audio to keep audio smooth(er) when running slowly Option to timestretch audio, keeping it smooth(er) when running slowly Feb 24, 2017
@hrydgard
Copy link
Owner Author

hrydgard commented Jun 9, 2018

Well, at least in 1.6.3 less games will run slow than in 1.5.4 , reducing the problem a little :)

But yes, this needs work. I don't think I'm gonna use that resampler library, it was unwieldy, unstable and high latency..

@ghost
Copy link

ghost commented Jun 21, 2018

screenshot_2018-06-21-21-48-52
So it will look like this?😮

@NotUnknownbrackets
Copy link

Can't wait for 1.8.
image

@hrydgard
Copy link
Owner Author

hrydgard commented Oct 7, 2018

Yeah I know I've just been pushing this forward but it's a tricky one. It will happen in one form or another eventually.

@ghost ghost mentioned this pull request Dec 15, 2018
@Narugakuruga
Copy link
Contributor

Why Citra but not Dolphin 🤔?

@marosis
Copy link

marosis commented Feb 5, 2019

We Are still waiting

@hrydgard hrydgard modified the milestones: v1.8.0, v1.9.0 Feb 10, 2019
@ghost ghost mentioned this pull request Feb 26, 2019
@ghost ghost mentioned this pull request Apr 5, 2019
@hrydgard hrydgard modified the milestones: v1.9.0, v1.10.0 Aug 7, 2019
@ghost
Copy link

ghost commented Aug 7, 2019

Sad I thought this is gonne go through v1.9.0 :(

@hrydgard
Copy link
Owner Author

hrydgard commented Aug 7, 2019

I haven't been able to get it to work well and stable unfortunately.

@ghost
Copy link

ghost commented Aug 7, 2019

@hrydgard Sir will you release v1.9.0 this month or September?

@hrydgard
Copy link
Owner Author

hrydgard commented Aug 7, 2019

September is more likely.

@Panderner
Copy link
Contributor

What about v1.10.0 or the future @hrydgard? You forgot it

@TheRobis
Copy link

Please, kind sir @hrydgard I really really need this :(

@orbea
Copy link
Contributor

orbea commented Mar 12, 2020

@hrydgard When you have time would you mind rebasing this PR so I can test to see how much it does or does not help issue #12705?

Or am I barking up the wrong tree?

@hrydgard
Copy link
Owner Author

I never could get this to work stable (it would always crash after a while). Dunno if I was misusing the time stretcher library or what.

I'll make another try someday if noone else beats me to it - maybe it's possible to get fairly close with simpler approaches, too.

@hrydgard
Copy link
Owner Author

Closing this one, will do another attempt at some point.

@hrydgard hrydgard closed this Apr 26, 2020
@NotUnknownbrackets
Copy link

😢

@hrydgard hrydgard deleted the timestretch-audio branch October 10, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet