mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
librosa (#44)
This commit is contained in:
@@ -3,7 +3,6 @@ import logging
|
|||||||
import re
|
import re
|
||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
|
||||||
import librosa
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
from .reply_on_pause import (
|
from .reply_on_pause import (
|
||||||
@@ -75,6 +74,7 @@ class ReplyOnStopWords(ReplyOnPause):
|
|||||||
self, audio: np.ndarray, sampling_rate: int, state: ReplyOnStopWordsState
|
self, audio: np.ndarray, sampling_rate: int, state: ReplyOnStopWordsState
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Take in the stream, determine if a pause happened"""
|
"""Take in the stream, determine if a pause happened"""
|
||||||
|
import librosa
|
||||||
duration = len(audio) / sampling_rate
|
duration = len(audio) / sampling_rate
|
||||||
|
|
||||||
if duration >= self.algo_options.audio_chunk_duration:
|
if duration >= self.algo_options.audio_chunk_duration:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "gradio_webrtc"
|
name = "gradio_webrtc"
|
||||||
version = "0.0.24"
|
version = "0.0.25"
|
||||||
description = "Stream images in realtime with webrtc"
|
description = "Stream images in realtime with webrtc"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "apache-2.0"
|
license = "apache-2.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user