Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zackees/playaudio
Easiest way to play a sound in a cross platform way
https://github.com/zackees/playaudio
Last synced: 3 months ago
JSON representation
Easiest way to play a sound in a cross platform way
- Host: GitHub
- URL: https://github.com/zackees/playaudio
- Owner: zackees
- License: mit
- Created: 2023-01-24T16:52:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-03T18:48:57.000Z (over 1 year ago)
- Last Synced: 2024-07-16T03:49:44.002Z (4 months ago)
- Language: Python
- Size: 120 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# playaudio
`pip install playaudio`
A cross platform solution for playing a sound in MacOS/Windows/Linux.
[![MacOS_Tests](../../actions/workflows/push_macos.yml/badge.svg)](../../actions/workflows/push_macos.yml)
[![Ubuntu_Tests](../../actions/workflows/push_ubuntu.yml/badge.svg)](../../actions/workflows/push_ubuntu.yml)
[![Win_Tests](../../actions/workflows/push_win.yml/badge.svg)](../../actions/workflows/push_win.yml)[![Linting](../../actions/workflows/lint.yml/badge.svg)](../../actions/workflows/lint.yml)
## Install
Uses the built in system commands to play audio.
# Usage
### Python
```python
from playaudio import playaudio
playaudio("my.mp3") # blocks until sound is played.
```### Command line
```bash
> pip install playaudio
> playaudio "my.mp3"
> playaudio # plays an included bell.mp3 sound.
```# Develop
PR's are welcome!
To develop software git clone the repo then run `. ./activate.sh`
# Windows
This environment requires you to use `git-bash`. This library expects a sound card to be installed. If you are running on a server then you will need to install a virtual sound card. See [windows setup here](.github/workflows/push_win.yml).
# Linting
Run `./lint.sh` to find linting errors using `pylint`, `flake8` and `mypy`.
# Releases:
* 1.0.4: Windows: Supports playing mp3 files
* 1.0.3: Adds ignore_errors=True for playaudio()
* 1.0.2: BELL_FILE -> BELL_MP3
* 1.0.1: Fix readme
* 1.0.0: Initial release