Skip to content

Commit

Permalink
Mention that audio is normalized when converting to wav in docs (#5835)
Browse files Browse the repository at this point in the history
* Mention that audio is normalized when converting to wav in docs

* add changeset

---------

Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 9, 2023
1 parent b83064d commit 4633478
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/five-showers-bet.md
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Mention that audio is normalized when converting to wav in docs
2 changes: 1 addition & 1 deletion gradio/components/audio.py
Expand Up @@ -46,7 +46,7 @@ class Audio(
"""
Creates an audio component that can be used to upload/record audio (as an input) or display audio (as an output).
Preprocessing: passes the uploaded audio as a {Tuple(int, numpy.array)} corresponding to (sample rate in Hz, audio data as a 16-bit int array whose values range from -32768 to 32767), or as a {str} filepath, depending on `type`.
Postprocessing: expects a {Tuple(int, numpy.array)} corresponding to (sample rate in Hz, audio data as a float or int numpy array) or as a {str} or {pathlib.Path} filepath or URL to an audio file, or bytes for binary content (recommended for streaming)
Postprocessing: expects a {Tuple(int, numpy.array)} corresponding to (sample rate in Hz, audio data as a float or int numpy array) or as a {str} or {pathlib.Path} filepath or URL to an audio file, or bytes for binary content (recommended for streaming). Note: When converting audio data from float format to WAV, the audio is normalized by its peak value to avoid distortion or clipping in the resulting audio.
Examples-format: a {str} filepath to a local file that contains audio.
Demos: main_note, generate_tone, reverse_audio
Guides: real-time-speech-recognition
Expand Down

0 comments on commit 4633478

Please sign in to comment.