parent
8c696b0586
commit
b53e0bb202
|
@ -13,7 +13,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
import time
|
import time
|
||||||
from Queue import Queue
|
from Queue import Queue, Empty
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
import speech_recognition as sr
|
import speech_recognition as sr
|
||||||
|
@ -96,9 +96,9 @@ class AudioConsumer(Thread):
|
||||||
self.read()
|
self.read()
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
audio = self.queue.get()
|
try:
|
||||||
|
audio = self.queue.get(0.5)
|
||||||
if audio is None:
|
except Empty:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.state.sleeping:
|
if self.state.sleeping:
|
||||||
|
|
Loading…
Reference in New Issue