tf.audio.encode_wav
Stay organized with collections
Save and categorize content based on your preferences.
Encode audio data using the WAV file format.
tf.audio.encode_wav(
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).
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).
|
Returns |
A Tensor of type string .
|
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. Some content is licensed under the numpy license.
Last updated 2021-02-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-02-18 UTC."],[],[]]