

specify audio dtype
@62119464db1e0f5f30fc3b7973f3331df791af05
--- whisper_online.py
+++ whisper_online.py
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 |
@lru_cache |
12 | 12 |
def load_audio(fname): |
13 | 13 |
a, _ = librosa.load(fname, sr=16000) |
14 |
- return a |
|
14 |
+ return a.astype('float32') |
|
15 | 15 |
|
16 | 16 |
def load_audio_chunk(fname, beg, end): |
17 | 17 |
audio = load_audio(fname) |
--- whisper_online_server.py
+++ whisper_online_server.py
... | ... | @@ -138,7 +138,7 @@ |
138 | 138 |
break |
139 | 139 |
sf = soundfile.SoundFile(io.BytesIO(raw_bytes), channels=1,endian="LITTLE",samplerate=SAMPLING_RATE, subtype="PCM_16",format="RAW") |
140 | 140 |
audio, _ = librosa.load(sf,sr=SAMPLING_RATE) |
141 |
- out.append(audio) |
|
141 |
+ out.append(audio.astype('float32')) |
|
142 | 142 |
if not out: |
143 | 143 |
return None |
144 | 144 |
return np.concatenate(out) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?