diff --git a/backend/youtube/helpers.go b/backend/youtube/helpers.go index 9bf21f4..3ec4bf2 100644 --- a/backend/youtube/helpers.go +++ b/backend/youtube/helpers.go @@ -50,12 +50,12 @@ func SortAudio(inFormats youtubev2.FormatList) youtubev2.FormatList { isStereoI := formats[i].AudioChannels == 2 isStereoJ := formats[j].AudioChannels == 2 if isStereoI && isStereoJ { - is44kI := formats[i].AudioSampleRate == "44100" - is44kJ := formats[j].AudioSampleRate == "44100" - if is44kI && is44kJ { + is48kI := formats[i].AudioSampleRate == "48000" + is48kJ := formats[j].AudioSampleRate == "48000" + if is48kI && is48kJ { return formats[i].Bitrate > formats[j].Bitrate } - return is44kI + return is48kI } return isStereoI } diff --git a/backend/youtube/helpers_test.go b/backend/youtube/helpers_test.go index 9547e92..f50233d 100644 --- a/backend/youtube/helpers_test.go +++ b/backend/youtube/helpers_test.go @@ -20,19 +20,19 @@ func TestSortAudio(t *testing.T) { MimeType: `audio/webm; codecs="opus"`, Bitrate: 350_000, AudioChannels: 2, - AudioSampleRate: "44100", + AudioSampleRate: "48000", }, { MimeType: `audio/mp4; codecs="mp4a.40.2"`, Bitrate: 250_000, AudioChannels: 2, - AudioSampleRate: "44100", + AudioSampleRate: "48000", }, { MimeType: `audio/webm; codecs="opus"`, Bitrate: 125_000, AudioChannels: 2, - AudioSampleRate: "44100", + AudioSampleRate: "48000", }, }