Skip to content

Commit

Permalink
Samples: Add 24 bit and 32 bit support for parsing wav files (#1993)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwu1 authored Apr 5, 2024
1 parent 480c62f commit 89427ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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;

default:
return AudioEncoding::INVALID;
Expand Down

0 comments on commit 89427ed

Please sign in to comment.