tensorBuffer property

TensorBuffer tensorBuffer

Returns a float {@link TensorBuffer} holding all the available audio samples in {@link android.media.AudioFormat#ENCODING_PCM_FLOAT} i.e. values are in the range of -1, 1.

Implementation

TensorBuffer get tensorBuffer {
  ByteBuffer byteBuffer = buffer.buffer;
  TensorBuffer tensorBuffer =
  // TODO: Confirm Shape
  TensorBuffer.createFixedSize(
      [1, byteBuffer
          .asFloat32List()
          .length
      ],
      TfLiteType.float32);
  tensorBuffer.loadBuffer(byteBuffer);
  return tensorBuffer;
}