# tf.raw_ops.EncodeWav

<br />

Encode audio data using the WAV file format.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.raw_ops.EncodeWav`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/EncodeWav)

<br />

    tf.raw_ops.EncodeWav(
        audio, sample_rate, name=None
    )

This operation will generate a string suitable to be saved out to create a .wav
audio file. It will be encoded in the 16-bit PCM format. It takes in float
values in the range -1.0f to 1.0f, and any outside that value will be clamped to
that range.

`audio` is a 2-D float Tensor of shape `[length, channels]`.
`sample_rate` is a scalar Tensor holding the rate to use (e.g. 44100).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `audio` | A `Tensor` of type `float32`. 2-D with shape `[length, channels]`. |
| `sample_rate` | A `Tensor` of type `int32`. Scalar containing the sample frequency. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type `string`. ||

<br />