mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-13 07:25:01 +08:00
fix type of sampling rate for encode_base64 (#24826)
Signed-off-by: co63oc <co63oc@users.noreply.github.com>
This commit is contained in:
parent
fc2dbcda8b
commit
1177dd53e9
@ -106,7 +106,7 @@ class AudioMediaIO(MediaIO[tuple[npt.NDArray, float]]):
|
|||||||
def load_file(self, filepath: Path) -> tuple[npt.NDArray, float]:
|
def load_file(self, filepath: Path) -> tuple[npt.NDArray, float]:
|
||||||
return librosa.load(filepath, sr=None)
|
return librosa.load(filepath, sr=None)
|
||||||
|
|
||||||
def encode_base64(self, media: tuple[npt.NDArray, float]) -> str:
|
def encode_base64(self, media: tuple[npt.NDArray, int]) -> str:
|
||||||
audio, sr = media
|
audio, sr = media
|
||||||
|
|
||||||
with BytesIO() as buffer:
|
with BytesIO() as buffer:
|
||||||
|
|||||||
@ -310,7 +310,7 @@ class MediaConnector:
|
|||||||
|
|
||||||
def encode_audio_base64(
|
def encode_audio_base64(
|
||||||
audio: np.ndarray,
|
audio: np.ndarray,
|
||||||
sampling_rate: float,
|
sampling_rate: int,
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Encode audio as base64."""
|
"""Encode audio as base64."""
|
||||||
audio_io = AudioMediaIO()
|
audio_io = AudioMediaIO()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user