Skip to content
This repository has been archived by the owner on Apr 13, 2018. It is now read-only.

Commit

Permalink
flake8 格式修正
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Jul 13, 2017
1 parent 5fa1ab5 commit 2e90a1a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 36 deletions.
21 changes: 0 additions & 21 deletions client/alteration.py

This file was deleted.

3 changes: 2 additions & 1 deletion client/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from brain import Brain
import time


class Conversation(object):

def __init__(self, persona, mic, profile):
Expand Down Expand Up @@ -76,4 +77,4 @@ def handleForever(self):
if input:
self.brain.query(input, self.wxbot)
else:
self.mic.say("什么?")
self.mic.say("什么?")
11 changes: 4 additions & 7 deletions client/mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import wave
import audioop
import pyaudio
import alteration
import dingdangpath
from app_utils import wechatUser

class Mic:

class Mic:
speechRec = None
speechRec_persona = None

Expand Down Expand Up @@ -57,7 +56,7 @@ def getScore(self, data):
def fetchThreshold(self):

# TODO: Consolidate variables from the next three functions
THRESHOLD_MULTIPLIER = 3
THRESHOLD_MULTIPLIER = 2.5
RATE = 16000
CHUNK = 1024

Expand Down Expand Up @@ -116,7 +115,7 @@ def passiveListen(self, PERSONA):
needs to be restarted.
"""

THRESHOLD_MULTIPLIER =3
THRESHOLD_MULTIPLIER = 2.5
RATE = 16000
CHUNK = 1024

Expand Down Expand Up @@ -322,13 +321,11 @@ def activeListenToAllOptions(self, THRESHOLD=None, LISTEN=True,

def say(self, phrase,
OPTIONS=" -vdefault+m3 -p 40 -s 160 --stdout > say.wav"):
# alter phrase before speaking
# phrase = alteration.clean(phrase)
if self.wxbot is not None:
wechatUser(self.profile, self.wxbot, "%s: %s" %
(self.robot_name, phrase), "")
self.speaker.say(phrase)

def play(self, src):
# play a voice
self.speaker.play(src)
self.speaker.play(src)
6 changes: 0 additions & 6 deletions client/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import subprocess
import pipes
import logging
import wave
import urllib
import requests
from abc import ABCMeta, abstractmethod
Expand All @@ -23,11 +22,6 @@
import argparse
import yaml

try:
import mad
except ImportError:
pass

import diagnose
import dingdangpath

Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
flake8 --exclude=wxbot.py,snowboydetect.py dingdang.py client
flake8 --exclude=wxbot.py,snowboydetect.py,client/mic_array dingdang.py client
nosetests -s --exe -v --with-coverage --cover-erase

0 comments on commit 2e90a1a

Please sign in to comment.