alowaniak / music-replacer

Replace OSRS music tracks with user defined music
BSD 2-Clause "Simplified" License
9 stars 5 forks source link

Importing local files - Playback too fast #3

Closed JaidenW closed 2 years ago

JaidenW commented 2 years ago

Hello. Fantastic plugin. has great potential. thanks so much for it.

I'm currently trying to use it to replace some of the OSRS music with RS3 music. which is working great, except certian songs which i'm importing from local files, when played back, play way too fast, at least double their intended BPM. I took a look at the actual config the plugin generates & i notice when it pulls a video from youtube, it pulls it's playback length, though from local files it does not. My guess is that this has something to do with the issue, but i really have no idea. I had no problems when pulling songs from youtube, only when i started importing local files.

Also, in regards to importing local files, it would be handy if it was possible to set a default directory you're always going to be importing files from, or use a more traditional file selector if possible, typing in the full path each time is not exactly efficent.

Also worth noting, when i playback the file manually, it plays at normal rate, ( i did run the files through a format converter)

Thanks again & hopefully you can find the cause of this.

JaidenW commented 2 years ago

Barbarianism.zip Here's an example of a file which, when imported, plays too fast.

alowaniak commented 2 years ago

This has most likely got to do with how your local .wav file is encoded by your format converter (for example lower sample/bit-rate). What I'm currently using to play the audio assumes it's "CD quality" (44.1khz 16bit 2channels). On my server-side (for the downloading from youtube) I use ffmpeg to convert it to <filename>.wav.

I'm planning on supporting more audio formats but I'm not sure when I'll get around to it; for now you could try using ffmpeg to convert your files or see if you can change some settings when using your format converter (to make sure the .wav is "16-bit, 44100fps, stereo, little-endian (aka CD Quality)").

A more traditional file selector is indeed a good suggestion, initially I liked the idea of keeping everything within osrs. But I can understand that's completely unworkable, I'll try to add it within a week or two.

JaidenW commented 2 years ago

thanks for that, i re-converted it using Shutter Encoder with the sample rate set to 44.1k and it's working correctly now.