Clean up Rigel's tcp module
This commit is contained in:
parent
6bd67afb1a
commit
d079d1c90e
21
rigel/tcp.py
21
rigel/tcp.py
|
@ -30,33 +30,14 @@ def to_wav_data(wav):
|
|||
|
||||
|
||||
def play(wav):
|
||||
#p = pyaudio.PyAudio()
|
||||
|
||||
try:
|
||||
# open stream
|
||||
# stream = p.open(format=p.get_format_from_width(wav.getsampwidth()),
|
||||
# channels=wav.getnchannels(),
|
||||
# rate=wav.getframerate(),
|
||||
# output=True)
|
||||
# stream = p.open(format=pyaudio.paInt16,
|
||||
# channels=1,
|
||||
# rate=22050,
|
||||
# output=True)
|
||||
|
||||
# stream.write(to_wav_data(wav))
|
||||
|
||||
# # stop stream
|
||||
# stream.stop_stream()
|
||||
# stream.close()
|
||||
# close PyAudio
|
||||
# Start audio
|
||||
play = sa.play_buffer(to_wav_data(wav), 1, 2, 22050)
|
||||
|
||||
# Wait for audio playback to finish before exiting
|
||||
play.wait_done()
|
||||
|
||||
finally:
|
||||
play.stop()
|
||||
#p.terminate()
|
||||
|
||||
|
||||
def synth(config):
|
||||
|
|
Loading…
Reference in New Issue