CarlQLange/fit — Issue #1: Errors when trying to play a song
Author: Ps0ke
Created: 2012-01-25 21:06:58+00:00
State: open

I'm trying to play a song thet definately is in my library, its all ascii caracters and no spaces in either artist or song name, `Easy` by `Cro` to be precise, and it fails with every method: The standard CLI, sox speech recognition and the server web interface.
I'd really love to test/use this, but it just doesn't work for me. Unfortunately I don't know python to fix it myself.

I have installed all the necessary dependencies:

iMac:~ Ps0ke$ brew list
flac hub libsndfile md5sha1sum readline
fortune lame libvorbis mercurial sox
gdbm libao lynx pkg-config sqlite
git libogg mad python3

The `fit` path is in my `$PATH`:

iMac:~ Ps0ke$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/Ps0ke/bin

All the necessary files are in there:

iMac:~ Ps0ke$ find ./bin
./bin
./bin/_fit
./bin/_fit/__init__.py
./bin/_fit/__pycache__
./bin/_fit/__pycache__/__init__.cpython-32.pyc
./bin/_fit/__pycache__/gspeech.cpython-32.pyc
./bin/_fit/__pycache__/recognise.cpython-32.pyc
./bin/_fit/gspeech.py
./bin/_fit/recognise.py
./bin/_fit/web
./bin/_fit/web/__init__.py
./bin/_fit/web/__pycache__
./bin/_fit/web/__pycache__/__init__.cpython-32.pyc
./bin/_fit/web/__pycache__/server.cpython-32.pyc
./bin/_fit/web/index.html
./bin/_fit/web/server.py
./bin/fit

Theres even a error message if no argument is given (I think you should fix that)

iMac:~ Ps0ke$ fit
Traceback (most recent call last):
File "/Users/Ps0ke/bin/fit", line 189, in
main()
File "/Users/Ps0ke/bin/fit", line 23, in main
if sys.argv[1] == 'listen':
IndexError: list index out of range

The CLI:

iMac:~ Ps0ke$ fit "play easy by cro"
Traceback (most recent call last):
File "/Users/Ps0ke/bin/fit", line 89, in artistnames
lib["Tracks"][track]["Has Video"]
KeyError: 'Has Video'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/Ps0ke/bin/fit", line 189, in
main()
File "/Users/Ps0ke/bin/fit", line 38, in main
ar = bestmatch(action[1][1], artistnames)
File "/Users/Ps0ke/bin/fit", line 124, in bestmatch
for trackname in matchto():
File "/Users/Ps0ke/bin/fit", line 91, in artistnames
if lib["Tracks"][track]["Artist"] not in artists:
KeyError: 'Artist'

The server:

iMac:~ Ps0ke$ fit serve
Serving on port 5171.
Go to 127.0.0.1:5171/_fit/web in your browser!
{'inp': ['play easy by cro']}
Traceback (most recent call last):
File "/Users/Ps0ke/bin/fit", line 89, in artistnames
lib["Tracks"][track]["Has Video"]
KeyError: 'Has Video'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/Ps0ke/bin/fit", line 189, in
main()
File "/Users/Ps0ke/bin/fit", line 38, in main
ar = bestmatch(action[1][1], artistnames)
File "/Users/Ps0ke/bin/fit", line 124, in bestmatch
for trackname in matchto():
File "/Users/Ps0ke/bin/fit", line 91, in artistnames
if lib["Tracks"][track]["Artist"] not in artists:
KeyError: 'Artist'
localhost - - [25/Jan/2012 21:30:38] "POST / HTTP/1.1" 200 -
^CTraceback (most recent call last):
File "/Users/Ps0ke/bin/fit", line 189, in
main()
File "/Users/Ps0ke/bin/fit", line 27, in main
server.serve()
File "/Users/Ps0ke/bin/_fit/web/server.py", line 17, in serve
httpd.serve_forever()
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/socketserver.py", line 225, in serve_forever
r, w, e = select.select([self], [], [], poll_interval)
KeyboardInterrupt

The listen:

iMac:~ Ps0ke$ fit listen
Start talking!
Heard you.
Traceback (most recent call last):
File "/Users/Ps0ke/bin/fit", line 189, in
main()
File "/Users/Ps0ke/bin/fit", line 24, in main
action = recognise.parse(gspeech.hearandinterpret(), definitions)
File "/Users/Ps0ke/bin/_fit/gspeech.py", line 36, in hearandinterpret
r = interpret(hear())
File "/Users/Ps0ke/bin/_fit/gspeech.py", line 18, in interpret
return json.loads(resp)["hypotheses"][0]["utterance"]
IndexError: list index out of range