Skip to content

Commit

Permalink
* Documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Jul 12, 2022
1 parent 5c9dd69 commit 51a84a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/de/presti/ree6/utils/data/AudioUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ private AudioUtil() {
*/
private static final int CHANNELS = 2;

/**
* Convert a PCM ByteBuffer into a WAV encoded byte array.
* @param byteBuffer The PCM ByteBuffer.
* @return The WAV encoded byte array.
* @throws IOException If an error occurs.
*/
public static byte[] convert(ByteBuffer byteBuffer) throws IOException {
AudioInputStream audioInputStream =
AudioSystem.getAudioInputStream(AudioFormat.Encoding.PCM_SIGNED,
Expand Down

0 comments on commit 51a84a7

Please sign in to comment.