pyaudio_np2bytes_bytes2np

import pyaudio
import wave
import numpy as np



data = None
p = pyaudio.PyAudio()

stream = p.open(format=pyaudio.paFloat32,channels=2,rate=44100,input=True)
frames = []
i = 0
while i < 1:
    data = stream.read(1024)
    frames.append(data)
    i += 1
print(frames)

raw = b"".join(frames)

print("------------------------------------------------------------------------------------------------------------------")

print(raw.tobytes())

你可能感兴趣的:(python,linux,算法)