audius-terminal-player
audius-terminal-player copied to clipboard
Fails on linux, no `afplay`
Error:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/gingka/Builds/audius-terminal-player/src/__main__.py", line 4, in <module>
main()
File "/home/gingka/Builds/audius-terminal-player/src/__init__.py", line 5, in main
Player()
File "/home/gingka/Builds/audius-terminal-player/src/tui/Player.py", line 121, in __init__
self.render()
File "/home/gingka/Builds/audius-terminal-player/src/tui/Player.py", line 158, in render
self.root.start()
File "/home/gingka/.local/lib/python3.10/site-packages/py_cui/__init__.py", line 316, in start
curses.wrapper(self._draw)
File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/home/gingka/.local/lib/python3.10/site-packages/py_cui/__init__.py", line 1684, in _draw
self._handle_key_presses(key_pressed)
File "/home/gingka/.local/lib/python3.10/site-packages/py_cui/__init__.py", line 1561, in _handle_key_presses
selected_widget._handle_key_press(key_pressed)
File "/home/gingka/.local/lib/python3.10/site-packages/py_cui/widgets.py", line 510, in _handle_key_press
Widget._handle_key_press(self, key_pressed)
File "/home/gingka/.local/lib/python3.10/site-packages/py_cui/widgets.py", line 342, in _handle_key_press
command()
File "/home/gingka/Builds/audius-terminal-player/src/tui/components/Table.py", line 83, in handle_select
self.select_callback(selection)
File "/home/gingka/Builds/audius-terminal-player/src/tui/Player.py", line 267, in play_track
playback.stream(self.current_track.id)
File "/home/gingka/Builds/audius-terminal-player/src/libs/playback.py", line 10, in stream
subprocess.Popen(["afplay", local_filepath])
File "/usr/lib/python3.10/subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'afplay'
System info:
- OS: EndeavourOS Rolling
- Python version: 3.10.2
This seems to only support Mac OS (as it uses the afplay command for Mac OS), which seems funny because something like this could easily use for example the playsound
library for python to offer playback on all operating systems.