Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradio/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def __init__(
theme: str = "default",
analytics_enabled: Optional[bool] = None,
mode: str = "blocks",
enable_queue: bool = False,
enable_queue: bool = None,
**kwargs,
):

Expand Down
7 changes: 6 additions & 1 deletion gradio/processing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ def resize_and_crop(img, size, crop_type="center"):


def audio_from_file(filename, crop_min=0, crop_max=100):
audio = AudioSegment.from_file(filename)
try:
audio = AudioSegment.from_file(filename)
except FileNotFoundError as e:
error_message = str(e)
if "ffprobe" in error_message:
print("Please install `ffmpeg` in your system to use Audio.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe clarify ffmpeg is needed to use non-WAV file formats, not the Audio component in general.

Comment thread
abidlabs marked this conversation as resolved.
Outdated
if crop_min != 0 or crop_max != 100:
audio_start = len(audio) * crop_min / 100
audio_end = len(audio) * crop_max / 100
Expand Down
6 changes: 5 additions & 1 deletion gradio/tunneling.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
import warnings
from io import StringIO

import paramiko
from cryptography.utils import CryptographyDeprecationWarning

with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=CryptographyDeprecationWarning)
import paramiko


def handler(chan, host, port):
Expand Down