From 1af8a233ce99b6c6a8a119eaa7363ebae1f2570f Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期三, 21 六月 2023 11:15:06 +0800
Subject: [PATCH] Merge branch 'main' of github.com:alibaba-damo-academy/FunASR add

---
 funasr/fileio/sound_scp.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/funasr/fileio/sound_scp.py b/funasr/fileio/sound_scp.py
index 7b35a35..c752fe6 100644
--- a/funasr/fileio/sound_scp.py
+++ b/funasr/fileio/sound_scp.py
@@ -52,11 +52,11 @@
         if self.normalize:
             # soundfile.read normalizes data to [-1,1] if dtype is not given
             array, rate = librosa.load(
-                wav, sr=self.dest_sample_rate, mono=not self.always_2d
+                wav, sr=self.dest_sample_rate, mono=self.always_2d
             )
         else:
             array, rate = librosa.load(
-                wav, sr=self.dest_sample_rate, mono=not self.always_2d, dtype=self.dtype
+                wav, sr=self.dest_sample_rate, mono=self.always_2d, dtype=self.dtype
             )
 
         if self.speed_perturb is not None:
@@ -67,6 +67,9 @@
                     [['speed', str(speed)], ['rate', str(rate)]])
                 array = array.view(-1).numpy()
 
+        if array.ndim==2:
+            array=array.transpose((1, 0))
+
         return rate, array
 
     def get_path(self, key):

--
Gitblit v1.9.1