You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
488 B
Python
22 lines
488 B
Python
import socket
|
|
import sys
|
|
|
|
# TODO Paramaterize the server target values
|
|
# TODO use python logger
|
|
|
|
if len(sys.argv) < 2:
|
|
raise ValueError("Missing input wav file")
|
|
|
|
wave_file_path = sys.argv[1]
|
|
|
|
if not wave_file_path.endswith('.wav'):
|
|
raise ValueError("File must have .wav file extension.")
|
|
|
|
(HOST,PORT)=('localhost',9000)
|
|
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM); s.connect((HOST,PORT))
|
|
|
|
with open(wave_file_path, 'rb') as wave_file:
|
|
s.sendfile(wave_file)
|
|
s.close()
|
|
|