-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for s32le, and improve reading of Wav files. (#116)
- Loading branch information
Showing
3 changed files
with
63 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
main/src/main/java/com/sedmelluq/discord/lavaplayer/container/wav/WaveFormatType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.sedmelluq.discord.lavaplayer.container.wav; | ||
|
||
import java.util.Arrays; | ||
|
||
public enum WaveFormatType { | ||
// https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/Pages%20from%20mmreg.h.pdf | ||
WAVE_FORMAT_UNKNOWN(0x0000), | ||
WAVE_FORMAT_PCM(0x0001), | ||
WAVE_FORMAT_EXTENSIBLE(0xFFFE); | ||
|
||
final int code; | ||
|
||
WaveFormatType(int code) { | ||
this.code = code; | ||
} | ||
|
||
static WaveFormatType getByCode(int code) { | ||
return Arrays.stream(values()).filter(type -> type.code == code).findFirst() | ||
.orElse(WAVE_FORMAT_UNKNOWN); | ||
} | ||
} |