@@ -65,8 +65,8 @@ public class TensorAudio {
65
65
private final TensorAudioFormat format ;
66
66
67
67
/**
68
- * Creates a {@link TensorAudio } instance with a ring buffer whose size is {@code sampleCounts} *
69
- * {@code format.getChannels()}.
68
+ * Creates a {@link android.media.AudioRecord } instance with a ring buffer whose size is {@code
69
+ * sampleCounts} * {@code format.getChannels()}.
70
70
*
71
71
* @param format the expected {@link TensorAudioFormat} of audio data loaded into this class.
72
72
* @param sampleCounts the number of samples to be fed into the model
@@ -76,11 +76,11 @@ public static TensorAudio create(TensorAudioFormat format, int sampleCounts) {
76
76
}
77
77
78
78
/**
79
- * Creates a {@link TensorAudio} instance with a ring buffer whose size is {@code sampleCounts} *
80
- * {@code format.getChannelCount()}.
79
+ * Creates a {@link android.media. TensorAudio} instance with a ring buffer whose size is {@code
80
+ * sampleCounts} * {@code format.getChannelCount()}.
81
81
*
82
- * @param format the {@link AudioFormat} required by the TFLite model. It defines the number of
83
- * channels and sample rate.
82
+ * @param format the {@link android.media. AudioFormat} required by the TFLite model. It defines
83
+ * the number of channels and sample rate.
84
84
* @param sampleCounts the number of samples to be fed into the model
85
85
*/
86
86
public static TensorAudio create (AudioFormat format , int sampleCounts ) {
@@ -135,8 +135,8 @@ public TensorAudioFormat build() {
135
135
/**
136
136
* Stores the input audio samples {@code src} in the ring buffer.
137
137
*
138
- * @param src input audio samples in {@link AudioFormat#ENCODING_PCM_FLOAT}. For multi-channel
139
- * input, the array is interleaved.
138
+ * @param src input audio samples in {@link android.media. AudioFormat#ENCODING_PCM_FLOAT}. For
139
+ * multi-channel input, the array is interleaved.
140
140
*/
141
141
public void load (float [] src ) {
142
142
load (src , 0 , src .length );
@@ -145,8 +145,8 @@ public void load(float[] src) {
145
145
/**
146
146
* Stores the input audio samples {@code src} in the ring buffer.
147
147
*
148
- * @param src input audio samples in {@link AudioFormat#ENCODING_PCM_FLOAT}. For multi-channel
149
- * input, the array is interleaved.
148
+ * @param src input audio samples in {@link android.media. AudioFormat#ENCODING_PCM_FLOAT}. For
149
+ * multi-channel input, the array is interleaved.
150
150
* @param offsetInFloat starting position in the {@code src} array
151
151
* @param sizeInFloat the number of float values to be copied
152
152
* @throws IllegalArgumentException for incompatible audio format or incorrect input size
@@ -164,8 +164,8 @@ public void load(float[] src, int offsetInFloat, int sizeInFloat) {
164
164
* Converts the input audio samples {@code src} to ENCODING_PCM_FLOAT, then stores it in the ring
165
165
* buffer.
166
166
*
167
- * @param src input audio samples in {@link AudioFormat#ENCODING_PCM_16BIT}. For multi-channel
168
- * input, the array is interleaved.
167
+ * @param src input audio samples in {@link android.media. AudioFormat#ENCODING_PCM_16BIT}. For
168
+ * multi-channel input, the array is interleaved.
169
169
*/
170
170
public void load (short [] src ) {
171
171
load (src , 0 , src .length );
@@ -175,8 +175,8 @@ public void load(short[] src) {
175
175
* Converts the input audio samples {@code src} to ENCODING_PCM_FLOAT, then stores it in the ring
176
176
* buffer.
177
177
*
178
- * @param src input audio samples in {@link AudioFormat#ENCODING_PCM_16BIT}. For multi-channel
179
- * input, the array is interleaved.
178
+ * @param src input audio samples in {@link android.media. AudioFormat#ENCODING_PCM_16BIT}. For
179
+ * multi-channel input, the array is interleaved.
180
180
* @param offsetInShort starting position in the src array
181
181
* @param sizeInShort the number of short values to be copied
182
182
* @throws IllegalArgumentException if the source array can't be copied
@@ -196,10 +196,10 @@ public void load(short[] src, int offsetInShort, int sizeInShort) {
196
196
}
197
197
198
198
/**
199
- * Loads latest data from the {@link AudioRecord} in a non-blocking way. Only supporting
200
- * ENCODING_PCM_16BIT and ENCODING_PCM_FLOAT.
199
+ * Loads latest data from the {@link android.media. AudioRecord} in a non-blocking way. Only
200
+ * supporting ENCODING_PCM_16BIT and ENCODING_PCM_FLOAT.
201
201
*
202
- * @param record an instance of {@link AudioRecord}
202
+ * @param record an instance of {@link android.media. AudioRecord}
203
203
* @return number of captured audio values whose size is {@code channelCount * sampleCount}. If
204
204
* there was no new data in the AudioRecord or an error occured, this method will return 0.
205
205
* @throws IllegalArgumentException for unsupported audio encoding format
@@ -250,7 +250,7 @@ public int load(AudioRecord record) {
250
250
251
251
/**
252
252
* Returns a float {@link TensorBuffer} holding all the available audio samples in {@link
253
- * AudioFormat#ENCODING_PCM_FLOAT} i.e. values are in the range of [-1, 1].
253
+ * android.media. AudioFormat#ENCODING_PCM_FLOAT} i.e. values are in the range of [-1, 1].
254
254
*/
255
255
public TensorBuffer getTensorBuffer () {
256
256
ByteBuffer byteBuffer = buffer .getBuffer ();
0 commit comments