使用python3在MACOSX中获取内部音频

问题描述

我正在尝试使用pyaudio在python中获取MACOSX的内部音频,但是我只能获取计算机的输入麦克风。如果我尝试使用头戴式耳机,它将无法正常工作。我已经看到了一些类似的帖子,但从未找到实际的解决方案。我已经尝试过使用sounddevice和声卡,但似乎没有任何效果。 这是我现在使用PyAudio代码

if __name__ == "__main__":
    sound = SoundSolver()
    sound.get_volume()
    stream = sound.get_stream()

    while stream.is_active():
        data = stream.read(num_frames=1024)
        rms = audioop.rms(data,2)
        print(SoundUtils.convert_rms_to_decibel(rms))
{{1}}

谢谢您的帮助,我真的被困在这里

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)