message: Audio Task Library: Introduce TensorAudio class
diff: @@ -67,18 +67,41 @@ ImageProcessor imageProcessor =
  // Create a TensorImage object. This creates the tensor of the corresponding
  // tensor type (uint8 in this case) that the TensorFlow Lite interpreter needs.
  -TensorImage tImage = new TensorImage(DataType.UINT8);
  +TensorImage tensorImage = new TensorImage(DataType.UINT8);
  // Analysis code for every frame
  // Preprocess the image
  -tImage.load(bitmap);
  -tImage = imageProcessor.process(tImage);
  +tensorImage.load(bitmap);
  +tensorImage = imageProcessor.process(tensorImage);
  ```
  `DataType` of a tensor can be read through the
  [metadata exractor library](../convert/metadata.md#read-the-metadata-from-models)
  as well as other model information.
  +### Baisc audio data processing
  +
  +The TensorFlow Lite Support Library also defines a `TensorAudio` class wrapping
  +some basic audio data processing methods. It's mostly used together with
  +[AudioRecord](https://developer.android.com/reference/android/media/AudioRecord)
  +and captures audio samples in a ring buffer.
  +
  +```java
  +import org.tensorflow.lite.support.audio.TensorAudio;
  +
  +// Create an `AudioRecord` instance.
  +AudioRecord record = AudioRecord(...)
  +
  +// Create a `TensorAudio` object from Android AudioFormat.
  +TensorAudio tensorAudio = new TensorAudio(record.getFormat(), size)
  +
  +// Load all audio samples available in the AudioRecord without blocking.
  +tensorAudio.load(record)
  +
  +// Get the `TensorBuffer` for inference.
  +TensorBuffer buffer = tensorAudio.getTensorBuffer()
  +```
  +
  ### Create output objects and run the model
  Before running the model, we need to create the container objects that will
  @@ -166,8 +189,8 @@ if (null != associatedAxisLabels) {
  The current version of the TensorFlow Lite Support Library covers:
  -* common data types (float, uint8, images and array of these objects) as
  - inputs and outputs of tflite models.
  +* common data types (float, uint8, images, audio and array of these objects)
  + as inputs and outputs of tflite models.
  * basic image operations (crop image, resize and rotate).
  * normalization and quantization
  * file utils
  @@ -219,7 +242,7 @@ When initiating input or output objects such as `TensorImage` or `TensorBuffer`
  you need to specify their types to be `DataType.UINT8` or `DataType.FLOAT32`.
  ```java
  -TensorImage tImage = new TensorImage(DataType.UINT8);
  +TensorImage tensorImage = new TensorImage(DataType.UINT8);
  TensorBuffer probabilityBuffer =
  TensorBuffer.createFixedSize(new int[]{1, 1001}, DataType.UINT8);
  ```
  