Skip to content

Commit 56ea533

Browse files
wangtzxunkai55
authored andcommitted
Audio Task Library Doc: Change all the reference to Android class to use full path
so that javadoc works. PiperOrigin-RevId: 373902337
1 parent ff7da70 commit 56ea533

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

tensorflow_lite_support/java/src/java/org/tensorflow/lite/support/audio/TensorAudio.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public class TensorAudio {
6565
private final TensorAudioFormat format;
6666

6767
/**
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()}.
7070
*
7171
* @param format the expected {@link TensorAudioFormat} of audio data loaded into this class.
7272
* @param sampleCounts the number of samples to be fed into the model
@@ -76,11 +76,11 @@ public static TensorAudio create(TensorAudioFormat format, int sampleCounts) {
7676
}
7777

7878
/**
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()}.
8181
*
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.
8484
* @param sampleCounts the number of samples to be fed into the model
8585
*/
8686
public static TensorAudio create(AudioFormat format, int sampleCounts) {
@@ -135,8 +135,8 @@ public TensorAudioFormat build() {
135135
/**
136136
* Stores the input audio samples {@code src} in the ring buffer.
137137
*
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.
140140
*/
141141
public void load(float[] src) {
142142
load(src, 0, src.length);
@@ -145,8 +145,8 @@ public void load(float[] src) {
145145
/**
146146
* Stores the input audio samples {@code src} in the ring buffer.
147147
*
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.
150150
* @param offsetInFloat starting position in the {@code src} array
151151
* @param sizeInFloat the number of float values to be copied
152152
* @throws IllegalArgumentException for incompatible audio format or incorrect input size
@@ -164,8 +164,8 @@ public void load(float[] src, int offsetInFloat, int sizeInFloat) {
164164
* Converts the input audio samples {@code src} to ENCODING_PCM_FLOAT, then stores it in the ring
165165
* buffer.
166166
*
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.
169169
*/
170170
public void load(short[] src) {
171171
load(src, 0, src.length);
@@ -175,8 +175,8 @@ public void load(short[] src) {
175175
* Converts the input audio samples {@code src} to ENCODING_PCM_FLOAT, then stores it in the ring
176176
* buffer.
177177
*
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.
180180
* @param offsetInShort starting position in the src array
181181
* @param sizeInShort the number of short values to be copied
182182
* @throws IllegalArgumentException if the source array can't be copied
@@ -196,10 +196,10 @@ public void load(short[] src, int offsetInShort, int sizeInShort) {
196196
}
197197

198198
/**
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.
201201
*
202-
* @param record an instance of {@link AudioRecord}
202+
* @param record an instance of {@link android.media.AudioRecord}
203203
* @return number of captured audio values whose size is {@code channelCount * sampleCount}. If
204204
* there was no new data in the AudioRecord or an error occured, this method will return 0.
205205
* @throws IllegalArgumentException for unsupported audio encoding format
@@ -250,7 +250,7 @@ public int load(AudioRecord record) {
250250

251251
/**
252252
* 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].
254254
*/
255255
public TensorBuffer getTensorBuffer() {
256256
ByteBuffer byteBuffer = buffer.getBuffer();

tensorflow_lite_support/java/src/java/org/tensorflow/lite/task/audio/classifier/AudioClassifier.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,12 @@ public long getRequiredInputBufferSize() {
392392
}
393393

394394
/**
395-
* Creates an {@link AudioRecord} instance to record audio stream. The returned AudioRecord
396-
* instance is initialized and client needs to call {@link AudioRecord#startRecording} method to
397-
* start recording.
395+
* Creates an {@link android.media.AudioRecord} instance to record audio stream. The returned
396+
* AudioRecord instance is initialized and client needs to call {@link
397+
* android.media.AudioRecord#startRecording} method to start recording.
398398
*
399-
* @return an {@link AudioRecord} instance in {@link AudioRecord#STATE_INITIALIZED}
399+
* @return an {@link android.media.AudioRecord} instance in {@link
400+
* android.media.AudioRecord#STATE_INITIALIZED}
400401
* @throws IllegalArgumentException if the model required channel count is unsupported
401402
* @throws IllegalStateException if AudioRecord instance failed to initialize
402403
*/

0 commit comments

Comments
 (0)