Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from "afplay" to "mpv" for cross-platform support #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ Terminal-based music player written in Python for the best music in the world

Browse and listen to [Audius](https://audius.co) from the comfort of your very own terminal. 🎶

Supported/tested platforms: MacOS 12+ 
Supported/tested platforms: MacOS 12+ , Arch Linux

## Install

📝 Prerequisites:
## 📝 Prerequisites:

- ☕ [Homebrew](https://brew.sh/)
- [mpv](https://mpv.io/)

## Install

### macOS
```
brew tap audiusproject/audius-terminal-player
brew install audius-terminal-player
Expand Down
4 changes: 2 additions & 2 deletions src/libs/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ def stream(track_id):
download_uri = api.get_redirect_uri(uri)
local_filepath = api.download_file(download_uri)
stop()
subprocess.Popen(["afplay", local_filepath])
subprocess.Popen(["mpv", local_filepath])


def stop():
subprocess.call(
["killall", "afplay"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
["killall", "mpv"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
)