Skip to content

Commit

Permalink
clost paths in cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sammachin committed Jan 12, 2016
1 parent 79723a2 commit cd0ef44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.py
Expand Up @@ -77,7 +77,7 @@ def alexa():
"format": "audio/L16; rate=16000; channels=1"
}
}
with open('recording.wav') as inf:
with open(path+'recording.wav') as inf:
files = [
('file', ('request', json.dumps(d), 'application/json; charset=UTF-8')),
('file', ('audio', inf, 'audio/L16; rate=16000; channels=1'))
Expand All @@ -91,7 +91,7 @@ def alexa():
for d in data:
if (len(d) >= 1024):
audio = d.split('\r\n\r\n')[1].rstrip('--')
with open("response.mp3", 'wb') as f:
with open(path+"response.mp3", 'wb') as f:
f.write(audio)
GPIO.output(25, GPIO.LOW)
os.system('mpg123 -q {}1sec.mp3 {}response.mp3'.format(path, path))
Expand Down

0 comments on commit cd0ef44

Please sign in to comment.