2010-07-21 11 views
0

В приведенном ниже коде используется 'getLevel()'. где я могу найти его (речь идет о звуке, и работать с pyaudio библиотеки)Где я могу найти getLevel()?

# 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 

ответ

0

Посмотрите на импорт, которые были выполнены. Вы найдете либо from someModule import getLevel, либо from someModule import *.

+0

Но в модуле pyaudio я не могу найти эту функцию. Я не знаю, в каком модуле я могу найти его. – CarolusPl

+0

Никто не сказал вам смотреть в pyaudio. Посмотрите код, который у вас есть перед вами. –