Player icon indicating copy to clipboard operation
Player copied to clipboard

Audio files with specific bitrates are played differently between RPG_RT and EasyRPG

Open Mimigris opened this issue 2 years ago • 6 comments

Name of the game:

Yume 2kki.

Player platform:

Windows, 64 bits continuous build of the Player.

Describe the issue in detail and how to reproduce it:

When the files dedp足音1.wav and dedp足音2.wav are played in EasyRPG, they are played differently compared to the RPG_RT. It seems to be related to the bitrate of the files, but this may need more test with other files and attempt to recreate the issue with other files and see how they behave.

Mimigris avatar Jun 28 '23 17:06 Mimigris

Where is this sound used (savegame next to it?) and can you check if this uses some dumb out-of-bounds pitch value?

Ghabry avatar Jul 10 '23 10:07 Ghabry

Where is this sound used (savegame next to it?)

If I'm not mistaken it plays in the Dark Museum (though where is it in it is another mystery).

Can you check if this uses some dumb out-of-bounds pitch value?

The issue reported here is with the default settings (100% speed) so it's not directly related to the pitch selected in-game.

Mimigris avatar Jul 10 '23 10:07 Mimigris

There is somehow no curation before submitting stuff to Yume2kki, or is there?

I mean this one second of PCM Wave at 192 Khz (!) has a size of 750 KB. o_O

Ghabry avatar Jul 10 '23 11:07 Ghabry

I played the audio files on Linux and in EasyRPG Player and they sound the same.

In RPG_RT there is a difference. So imo that is a problem with RPG_RT then because it plays the file incorrectly due to the high sample rate?

How does it sound on windows?

dedp.zip

Ghabry avatar Jul 10 '23 11:07 Ghabry

I get a quite similiar sound in the Player when I double the frequency to 192*2 kHz. Doesn't make sense why this happens. Guess there is internally some calculation overflowing because the frequency is too high. 🤷

Ghabry avatar Jul 10 '23 12:07 Ghabry

I found the reason: To set Pitch, RPG_RT uses SetFrequency in DirectSound. Its range is 100 to 100,000 Hz. So if a sound is 96 kHz, you can't really make the pitch higher than 100% (110 to 150 become 104.2%). And if it's 192 kHz, all pitch values become 52.1% except 50.

The highest sample rate that works correctly is 66,667 Hz

Lt-knb avatar Aug 17 '25 06:08 Lt-knb