Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试加载一个音频文件(通过PySoundFile)并让它返回一个bytes. 但是 currentdtype是['float32', 'float64', 'int16', 'int32']
PySoundFile
bytes
dtype
['float32', 'float64', 'int16', 'int32']
我需要它bytes来使用pocketsphinx:decoder.process_raw
pocketsphinx
decoder.process_raw
audio_data = self.SOUND_FILE.read(sample_frames, dtype='int16') audio_bytes = audio_data.tobytes()