我正在嘗試加載一個音頻文件(通過PySoundFile)并讓它返回一個bytes. 但是 currentdtype是['float32', 'float64', 'int16', 'int32']我需要它bytes來使用pocketsphinx:decoder.process_raw
1 回答

九州編程
TA貢獻(xiàn)1785條經(jīng)驗 獲得超4個贊
audio_data = self.SOUND_FILE.read(sample_frames, dtype='int16') audio_bytes = audio_data.tobytes()
添加回答
舉報
0/150
提交
取消