Nava is a Python library that allows users to play sound in Python without any dependencies or platform restrictions. It is a cross-platform solution that runs on any operating system, including Windows, macOS, and Linux. Its lightweight and easy-to-use design makes Nava an ideal choice for developers looking to add sound functionality to their Python programs.
PyPI Counter | |
Github Stars |
Branch | main | dev |
Linux CI | ||
Windows CI | ||
macOS CI |
Code Quality |
- Check Python Packaging User Guide
- Run
pip install nava==0.7
- Download Version 0.7 or Latest Source
- Run
pip install .
- Check Conda Managing Package
- Update Conda using
conda update conda
- Run
conda install -c openscilab nava
from nava import play
play("alarm.wav")
async_mode
parameter has a default value of False
import time
from nava import play, stop
sound_id = play("alarm.wav", async_mode=True)
time.sleep(4)
stop(sound_id)
loop
parameter has a default value of False
async_mode
flag when you are using loop
from nava import play, stop
sound_id = play("alarm.wav", async_mode=True, loop=True)
time.sleep(100)
stop(sound_id)
from nava import play, NavaBaseError
try:
play("alarm.wav")
except NavaBaseError as e:
print(str(e))
engine
parameter has a default value of AUTO
from nava import play, Engine
sound_id = play("alarm.wav", engine=Engine.AFPLAY)
$ nava [--file FILE_PATH] [--loop] FILE_PATH
List of different platforms and the corresponding engines that are used for sound playing.
Engine | Platform | References | Supported Formats |
---|---|---|---|
ALSA |
Linux | Advanced Linux Sound Architecture | .wav |
WINSOUND |
Windows | Winsound | .wav |
AFPLAY |
macOS | Audio File Play | .wav ,.mp3 |
Just fill an issue and describe it. We'll check it ASAP! or send an email to nava@openscilab.com.
- Please complete the issue template
You can also join our discord server
Give a ⭐️ if this project helped you!
If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .