From adc88bd9e76644badbbe006913addfa7cbe5d89c Mon Sep 17 00:00:00 2001
From: shixian.shi <shixian.shi@alibaba-inc.com>
Date: 星期四, 23 十一月 2023 20:40:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'refs/remotes/origin/main' update contextual forward

---
 funasr/utils/speaker_utils.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/funasr/utils/speaker_utils.py b/funasr/utils/speaker_utils.py
index a1c610f..38ef11c 100644
--- a/funasr/utils/speaker_utils.py
+++ b/funasr/utils/speaker_utils.py
@@ -12,7 +12,7 @@
 from typing import Any, Dict, List, Union
 
 import numpy as np
-import soundfile as sf
+import librosa as sf
 import torch
 import torchaudio
 import logging
@@ -43,7 +43,7 @@
         for i in range(len(inputs)):
             if isinstance(inputs[i], str):
                 file_bytes = File.read(inputs[i])
-                data, fs = sf.read(io.BytesIO(file_bytes), dtype='float32')
+                data, fs = sf.load(io.BytesIO(file_bytes), dtype='float32')
                 if len(data.shape) == 2:
                     data = data[:, 0]
                 data = torch.from_numpy(data).unsqueeze(0)

--
Gitblit v1.9.1