Skip to content
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

Samples: Add 24 bit and 32 bit support for parsing wav files #1993

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions samples/parselib/src/main/cpp/wav/AudioEncoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class AudioEncoding {
static const int PCM_16 = 0;
static const int PCM_8 = 1;
static const int PCM_IEEEFLOAT = 2;
static const int PCM_24 = 3;
static const int PCM_32 = 4;
};

} // namespace parselib
Expand Down
6 changes: 4 additions & 2 deletions samples/parselib/src/main/cpp/wav/WavStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ int WavStreamReader::getSampleEncoding() {
return AudioEncoding::PCM_16;

case 24:
// TODO - Support 24-bit WAV data
return AudioEncoding::INVALID; // for now
return AudioEncoding::PCM_24;

case 32:
return AudioEncoding::PCM_32;
robertwu1 marked this conversation as resolved.
Show resolved Hide resolved

default:
return AudioEncoding::INVALID;
Expand Down