Skip to content

Commit

Permalink
Fixed audio save bit depth
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Jul 28, 2024
1 parent fe86031 commit edd7c0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/audioCore/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ namespace utils {
auto format = utils::findAudioFormat(file, true);
if (!format) { return nullptr; }

/** Limit Bit Depth To Solve MP3 Bit Depth Problem */
auto bitDepths = format->getPossibleBitDepths();
if (!bitDepths.contains(bitDepth)) {
bitDepth = bitDepths.getLast();
}

auto outStream = new juce::FileOutputStream(file);
if (outStream->openedOk()) {
outStream->setPosition(0);
Expand Down

0 comments on commit edd7c0c

Please sign in to comment.