Package ai.djl.modality.audio
Class Audio
- java.lang.Object
-
- ai.djl.modality.audio.Audio
-
public class Audio extends java.lang.ObjectAudiois a container of an audio in DJL. The raw data of the audio is wrapped in a float array.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetChannels()Returns the number of channels of an audio file.float[]getData()Returns the float array data.floatgetSampleRate()Returns the sample rate.
-
-
-
Constructor Detail
-
Audio
public Audio(float[] data)
Constructs a newAudioinstance.- Parameters:
data- the wrapped float array data
-
Audio
public Audio(float[] data, float sampleRate, int channels)Constructs a newAudioinstance.- Parameters:
data- the wrapped float array datasampleRate- the sample ratechannels- number of channels
-
-
Method Detail
-
getData
public float[] getData()
Returns the float array data.- Returns:
- The float array data.
-
getSampleRate
public float getSampleRate()
Returns the sample rate.- Returns:
- sample rate.
-
getChannels
public int getChannels()
Returns the number of channels of an audio file.- Returns:
- the number of channels of an audio file
-
-