Skip to content

Yume 2kki: Certain music crackles/pops audibly when looping #2666

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

Closed
Monocarpic3926 opened this issue Oct 28, 2021 · 5 comments · Fixed by #2762
Closed

Yume 2kki: Certain music crackles/pops audibly when looping #2666

Monocarpic3926 opened this issue Oct 28, 2021 · 5 comments · Fixed by #2762

Comments

@Monocarpic3926
Copy link

Name of the game:

Yume 2kki

Player platform:

Windows

Attach files (as a .zip archive or link them)

tut
music.zip
easyrpg_log.txt

Describe the issue in detail and how to reproduce it:

Certain music in the game audibly pops when it loops, compared with playing on RPG Maker 2000 where the same music, whilst still making a popping sound if listening carefully, is significantly quieter. Above is a GIF showing how to quickly get to two areas in the game where this occurs, with text of the music filenames appearing when in the area where that music plays. I've also included a zip file that contains the two different music examples - one that is a recording of the music taken in EasyRPG, then for comparison that same music recorded in RPG Maker, and then the original music files that both programs are reading from.

@Ghabry Ghabry added the Audio label Oct 28, 2021
@Ghabry
Copy link
Member

Ghabry commented Nov 1, 2021

That is a bug in our resampler. When the resampler is off it sounds like in RPG_RT :/

The resampler is also lots of legacy code nobody touched in years...

@Monocarpic3926
Copy link
Author

That is a bug in our resampler. When the resampler is off it sounds like in RPG_RT :/

The resampler is also lots of legacy code nobody touched in years...

Thank you for the explanation. Is there an option to turn off the resampler? I checked the manual for relevant flags but the only flag I can find related to audio is one that looks like it just disables audio altogether.

@Ghabry
Copy link
Member

Ghabry commented Nov 1, 2021

You cannot disable the resampler because it ensures that everything plays at the correct samplerate (usually 48kHz). The tracks are 8kHZ which means they would normally play very fast without resampling.

@Monocarpic3926
Copy link
Author

You cannot disable the resampler because it ensures that everything plays at the correct samplerate (usually 48kHz). The tracks are 8kHZ which means they would normally play very fast without resampling.

That sucks, but that does make sense. Hopefully it gets fixed at some point because aside from this the game runs beautifully.

@Ghabry
Copy link
Member

Ghabry commented Dec 28, 2021

Imo the best solution is to refactor AudioDecoder + AudioResampler next and merging them into one class.

Don't think this is easily solvable right now because the interaction of AudioDecoder wrapped into Resampler is very complex. Especially since MIDI events were added.

Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Apr 3, 2022
For a smooth looping without gaps the wrapped_decoder must be able to loop.

The solution is more of a hack / short-term solution:
All loop-related methods were forwarded to the wrapped_decoder

The better, more complex solution is refactoring the code by merging Decoder+Resampler
to give more control about the decoding process without all this ugly forwarding.

Fix EasyRPG#2666
@Ghabry Ghabry added this to the 0.7.1 milestone Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants