python - 关闭流后出现错误?

标签 python macos audio

关闭流后,它仍在尝试记录,并且得到:

(1) Error recording: [Errno Stream closed] -9988

这些错误很多。我告诉程序记录1000个音量输入值。我如何告诉它退出录制,同时关闭视频流?

最佳答案

您可以尝试异常处理:

try:
    # Your code here
except Exception, e:
    print "Error:", e

关于python - 关闭流后出现错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21447328/

相关文章:

python - 为什么 doctests 在使用 Sphinx 的 `make doctest` 运行时会引发 NameError ?

python - 如何在 PDF 文档中搜索公司名称或股票代码?

java - GL20.glCompileShader 使用 OpenGL 的 Java 程序崩溃

python - 在不重新绘制整个图形的情况下更新图形上的艺术家 (Line2D) - axes.draw_artist() 崩溃

python - DataSift python API : Difference between datasift. client.subscribe 和 datasift.push.create_from_hash?

python - 同时运行两个进程

macos - 从 NSTokenField 中删除选定的 token

python - 支持提示表的Python音频播放库

android - 音频无法在APK中运行

html - HTML声音拒绝循环播放