# tf.contrib.ffmpeg.encode_audio

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/ffmpeg/ffmpeg_ops.py#L77-L101) |

Creates an op that encodes an audio file using sampled audio from a tensor. (deprecated)

    tf.contrib.ffmpeg.encode_audio(
        audio, file_format=None, samples_per_second=None
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed after 2018-09-04. Instructions for updating: tf.contrib.ffmpeg will be removed in 2.0, the support for video and audio will continue to be provided in tensorflow-io: <https://github.com/tensorflow/io>

<br />

<br />

<br />

| ## Args ||
|---|---|
| `audio` | A rank-2 `Tensor` that has time along dimension 0 and channels along dimension 1. Dimension 0 is `samples_per_second * length_in_seconds` long. |
| `file_format` | The type of file to encode, as a string or rank-0 string tensor. "wav" is the only supported format. |
| `samples_per_second` | The number of samples in the audio tensor per second of audio, as an `int` or rank-0 `int32` tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A scalar tensor that contains the encoded audio in the specified file format. ||

<br />