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)=('0.0.0.0',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()

