mirror of
https://github.com/QuentinFuxa/WhisperLiveKit.git
synced 2026-03-07 22:33:36 +00:00
specify audio dtype
This commit is contained in:
@@ -11,7 +11,7 @@ import math
|
||||
@lru_cache
|
||||
def load_audio(fname):
|
||||
a, _ = librosa.load(fname, sr=16000)
|
||||
return a
|
||||
return a.astype('float32')
|
||||
|
||||
def load_audio_chunk(fname, beg, end):
|
||||
audio = load_audio(fname)
|
||||
|
||||
@@ -138,7 +138,7 @@ class ServerProcessor:
|
||||
break
|
||||
sf = soundfile.SoundFile(io.BytesIO(raw_bytes), channels=1,endian="LITTLE",samplerate=SAMPLING_RATE, subtype="PCM_16",format="RAW")
|
||||
audio, _ = librosa.load(sf,sr=SAMPLING_RATE)
|
||||
out.append(audio)
|
||||
out.append(audio.astype('float32'))
|
||||
if not out:
|
||||
return None
|
||||
return np.concatenate(out)
|
||||
|
||||
Reference in New Issue
Block a user