-
Notifications
You must be signed in to change notification settings - Fork 505
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
Set Sample Rate to 32000 hz #4780
base: develop
Are you sure you want to change the base?
Conversation
soh/soh/OTRGlobals.cpp
Outdated
#if 0 | ||
// Values for 44100 hz | ||
#define SAMPLES_HIGH 752 | ||
#define SAMPLES_LOW 720 | ||
#else | ||
// Values for 32000 hz | ||
#define SAMPLES_HIGH 560 | ||
#define SAMPLES_LOW 528 | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of this can we just change
//AudioMgr_ThreadEntry(&gAudioMgr);
// 528 and 544 relate to 60 fps at 32 kHz 32000/60 = 533.333..
// in an ideal world, one third of the calls should use num_samples=544 and two thirds num_samples=528
//#define SAMPLES_HIGH 560
//#define SAMPLES_LOW 528
// PAL values
//#define SAMPLES_HIGH 656
//#define SAMPLES_LOW 624
// 44KHZ values
#if 0
// Values for 44100 hz
#define SAMPLES_HIGH 752
#define SAMPLES_LOW 720
#else
// Values for 32000 hz
#define SAMPLES_HIGH 560
#define SAMPLES_LOW 528
#endif
to
//AudioMgr_ThreadEntry(&gAudioMgr);
// 528 and 544 relate to 60 fps at 32 kHz 32000/60 = 533.333..
// in an ideal world, one third of the calls should use num_samples=544 and two thirds num_samples=528
#define SAMPLES_HIGH 560
#define SAMPLES_LOW 528
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you willing to lose values for 44100? You don't rather have this for quick change and testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the experience we've had so far with 44k, I doubt we'll go back, but if we do, we can look for this PR to see the differences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree with @Malkierian. if someone wants to try to get 44.1k working again they can check the git blame and find them
@@ -354,7 +354,7 @@ OTRGlobals::OTRGlobals() { | |||
overlay->LoadFont("Fipps", 32.0f, "fonts/Fipps-Regular.otf"); | |||
overlay->SetCurrentFont(CVarGetString(CVAR_GAME_OVERLAY_FONT, "Press Start 2P")); | |||
|
|||
context->InitAudio({ .SampleRate = 44100, .SampleLength = 1024, .DesiredBuffered = 2480 }); | |||
context->InitAudio({ .SampleRate = 32000, .SampleLength = 1024, .DesiredBuffered = 2480 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like DesiredBuffered
was changed for 44.1k here
int SDLAudioPlayer::GetDesiredBuffered(void) {
- return 1680;
+ return 2480;
}
interestingly, it seems SampleLength
was already 1024 before the switch to 44.1k
i also am not sure where these values are coming from:
32000/1680 = 19.047619048
44100/2480 = 17.782258065
@Kenix3 @NEstelami any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find that. Where is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shipwright/libultraship/libultraship/SDLAudioPlayer.cpp
Lines 31 to 33 in d24c845
int SDLAudioPlayer::GetDesiredBuffered(void) { | |
return 1680; | |
} |
vs
Shipwright/libultraship/libultraship/SDLAudioPlayer.cpp
Lines 31 to 33 in 1f1b81a
int SDLAudioPlayer::GetDesiredBuffered(void) { | |
return 2480; | |
} |
and
Shipwright/libultraship/libultraship/WasapiAudioPlayer.cpp
Lines 83 to 85 in 09432ee
int WasapiAudioPlayer::GetDesiredBuffered(void) { | |
return 1680; | |
} |
vs
Shipwright/libultraship/libultraship/WasapiAudioPlayer.cpp
Lines 83 to 85 in 1f1b81a
int WasapiAudioPlayer::GetDesiredBuffered(void) { | |
return 2480; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change fixes Vibrato and Portamento issues with the port.
Build Artifacts