tfio.audio.AudioIOTensor
Stay organized with collections
Save and categorize content based on your preferences.
AudioIOTensor
tfio.audio.AudioIOTensor(
filename, dtype=None
)
Used in the notebooks
Attributes |
dtype
|
Returns the dtype of elements in the tensor.
|
rate
|
The sample rate of the audio stream
|
shape
|
Returns the TensorShape that represents the shape of the tensor.
|
Methods
to_tensor
View source
to_tensor()
Converts this IOTensor
into a tf.Tensor
.
Args |
name
|
A name prefix for the returned tensors (optional).
|
Returns |
A Tensor with value obtained from this IOTensor .
|
__getitem__
View source
__getitem__(
key
)
Returns the specified piece of this IOTensor.
__len__
View source
__len__()
Returns the total number of items of this IOTensor.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-02-15 UTC.
[null,null,["Last updated 2022-02-15 UTC."],[],[],null,["# tfio.audio.AudioIOTensor\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/ops/audio_ops.py#L654-L747) |\n\nAudioIOTensor \n\n tfio.audio.AudioIOTensor(\n filename, dtype=None\n )\n\n### Used in the notebooks\n\n| Used in the tutorials |\n|--------------------------------------------------------------------------------------------|\n| - [Audio Data Preparation and Augmentation](https://www.tensorflow.org/io/tutorials/audio) |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|---------|--------------------------------------------------------------------|\n| `dtype` | Returns the `dtype` of elements in the tensor. |\n| `rate` | The sample `rate` of the audio stream |\n| `shape` | Returns the `TensorShape` that represents the shape of the tensor. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `to_tensor`\n\n[View source](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/ops/audio_ops.py#L707-L716) \n\n to_tensor()\n\nConverts this `IOTensor` into a [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|--------|----------------------------------------------------|\n| `name` | A name prefix for the returned tensors (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A `Tensor` with value obtained from this `IOTensor`. ||\n\n\u003cbr /\u003e\n\n### `__getitem__`\n\n[View source](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/ops/audio_ops.py#L721-L743) \n\n __getitem__(\n key\n )\n\nReturns the specified piece of this IOTensor.\n\n### `__len__`\n\n[View source](https://github.com/tensorflow/io/blob/v0.24.0/tensorflow_io/python/ops/audio_ops.py#L745-L747) \n\n __len__()\n\nReturns the total number of items of this IOTensor."]]