0

以下のコードでは を使用していgetLevel()ます。どこで見つけられますか (サウンドに関するもので、pyaudio ライブラリで実行されます)

# this is the threshold that determines whether or not sound is detected
THRESHOLD = 0

#open your audio stream    

# wait until the sound data breaks some level threshold
while True:
    data = stream.read(chunk)
    # check level against threshold, you'll have to write getLevel()
    if getLevel(data) > THRESHOLD:
        break

# record for however long you want
# close the stream
4

2 に答える 2

2

https://docs.python.org/library/audioop.htmlをご覧ください。 これはオーディオを処理する別の python モジュールですが、オーディオ レベルを取得する方法があるようです ( max(fragment, width) ) ) )。

于 2010-07-21T08:32:31.293 に答える
0

実行されたインポートを見てください。from someModule import getLevel、または のいずれかが見つかりますfrom someModule import *

于 2010-07-21T08:18:03.043 に答える