Skip to content

Feature sample rate2#258

Open
simotek wants to merge 2 commits into
djdiskmachine:masterfrom
simotek:feature-sample-rate2
Open

Feature sample rate2#258
simotek wants to merge 2 commits into
djdiskmachine:masterfrom
simotek:feature-sample-rate2

Conversation

@simotek
Copy link
Copy Markdown

@simotek simotek commented May 28, 2026

Description

SDL2 will attempt to start audio at the sample rate specified in
AUDIOSAMPLERATE. lgpt will now then run correctly at whichever
sample rate SDL2 returns.

Modern Linux systems running pipewire default to 48000 this allows
lgpt to run at the native sample rate.

clang-format was also run in a secondary commit.

Type of change

Please delete option that isn't relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions on how to reproduce.

Test Configuration:

  • Hardware: Laptop
  • OS version: openSUSE Tumbleweed

Played the old beta test song, a sound font and a couple of my songs,

Checklist:

  • I have performed a self-review of my code
  • I have commented particularly in hard-to-understand areas
  • I have updated documentation regarding my changes
  • My changes generate no new warnings

simotek added 2 commits May 28, 2026 20:34
SDL2 will attempt to start audio at the sample rate specified in
AUDIOSAMPLERATE. lgpt will now then run correctly at whichever
sample rate SDL2 returns.

Modern Linux systems running pipewire default to 48000 this allows
lgpt to run at the native sample rate.
Copy link
Copy Markdown
Owner

@djdiskmachine djdiskmachine left a comment

Choose a reason for hiding this comment

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

I like it! Feels like Piggy is entering the 2010s now, pretty sweet!
Maybe we can have a list of reasonable sample rates to accept, probably nothing above 48 and below 44.1 kHz?

};

int SDLAudioDriver::GetSampleRate() {
if (sampleRate_ == 0) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

are we allowing all types of weird sample rates? I know 11something kHz is pretty common if we have had connected bluetooth realtime devices..

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.

2 participants