Package struct
Class AudioData
java.lang.Object
struct.AudioData
The class dealing with the audio information in game such as raw audio data, FFT and Mel-Spectrogram transformation.
For more details on the data structure, please see https://tinyurl.com/DareFightingICE/AI.
For more details on the data structure, please see https://tinyurl.com/DareFightingICE/AI.
-
Field Summary
Modifier and TypeFieldDescriptionprivate FFTData[]
Fourier-transformed audio data.private float[][]
Raw audio data.private byte[]
Raw audio data as byte sequence.private float[][][]
Mel-Spectrogram audio data.private byte[]
Mel-Spectrogram audio data as byte sequence. -
Method Summary
Modifier and TypeMethodDescriptionFFTData[]
Gets Fast Fourier Transform data.float[][]
Gets raw audio data.byte[]
Byte sequence version ofgetRawData()
.
This method is recommended for Python-based AIfloat[][][]
Gets Mel-Spectrogram data.byte[]
Byte sequence version ofgetSpectrogramData()
.
This method is recommended for Python-based AI
-
Field Details
-
rawData
private float[][] rawDataRaw audio data. -
rawDataAsBytes
private byte[] rawDataAsBytesRaw audio data as byte sequence. -
fftData
Fourier-transformed audio data. -
spectrogramData
private float[][][] spectrogramDataMel-Spectrogram audio data. -
spectrogramDataAsBytes
private byte[] spectrogramDataAsBytesMel-Spectrogram audio data as byte sequence.
-
-
Method Details
-
getRawData
public float[][] getRawData()Gets raw audio data.- Returns:
- raw audio data.
-
getRawDataAsBytes
public byte[] getRawDataAsBytes()Byte sequence version ofgetRawData()
.
This method is recommended for Python-based AI- Returns:
- raw audio data as byte sequence.
-
getFftData
Gets Fast Fourier Transform data.- Returns:
- Fast Fourier Transform data.
-
getSpectrogramData
public float[][][] getSpectrogramData()Gets Mel-Spectrogram data.- Returns:
- Mel-Spectrogram data.
-
getSpectrogramDataAsBytes
public byte[] getSpectrogramDataAsBytes()Byte sequence version ofgetSpectrogramData()
.
This method is recommended for Python-based AI- Returns:
- Mel-Spectrogram data as byte sequence.
-