Package toxi.audio
Class SynthUtil
java.lang.Object
toxi.audio.SynthUtil
This class provides static conversion tools for translating normalized
floating point wave data into 16bit PCM.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AudioBuffer
floatArrayTo16bitBuffer
(JOALUtil audioSys, float[] raw, int rate) static byte[]
floatArrayTo16bitPCM
(float[] raw) static AudioBuffer
floatArrayTo16bitStereoBuffer
(JOALUtil audioSys, float[] raw, int rate) static AudioBuffer
floatArrayTo8bitBuffer
(JOALUtil audioSys, float[] raw, int rate) static byte[]
floatArrayTo8bitPCM
(float[] raw) static AudioBuffer
floatArrayTo8bitStereoBuffer
(JOALUtil audioSys, float[] raw, int rate) static float[]
joinMonoFloatArrays
(float[] left, float[] right) Merges the two given mono arrays into an interleaved stereo array in left-right order.
-
Constructor Details
-
SynthUtil
public SynthUtil()
-
-
Method Details
-
floatArrayTo16bitBuffer
-
floatArrayTo16bitPCM
public static byte[] floatArrayTo16bitPCM(float[] raw) -
floatArrayTo16bitStereoBuffer
-
floatArrayTo8bitBuffer
-
floatArrayTo8bitPCM
public static byte[] floatArrayTo8bitPCM(float[] raw) -
floatArrayTo8bitStereoBuffer
-
joinMonoFloatArrays
public static float[] joinMonoFloatArrays(float[] left, float[] right) Merges the two given mono arrays into an interleaved stereo array in left-right order.- Parameters:
left
-right
-- Returns:
- stereo array
-