Skip to main content

Nava


built with Python3 PyPI version Codecov Discord Channel

Overview

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 PyPI Downloads
Github Stars
Branch main dev
Linux CI
Windows CI
macOS CI
Code Quality CodeFactor

Installation

PyPI

Source code

Conda

Usage

Basic

from nava import play
play("alarm.wav")

Async mode

⚠️ The 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 mode

⚠️ The loop parameter has a default value of False

⚠️ You should always set 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)

Error

from nava import play, NavaBaseError

try:
    play("alarm.wav")
except NavaBaseError as e:
    print(str(e))

Engine

⚠️ The engine parameter has a default value of AUTO

from nava import play, Engine
sound_id = play("alarm.wav", engine=Engine.AFPLAY)

CLI

$ nava [--file FILE_PATH] [--loop] [--engine ENGINE] FILE_PATH

Engines list

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
WINMM Windows Windows MCI (Media Control Interface) .wav, .mp3, .avi
AFPLAY macOS Audio File Play .wav, .mp3

Issues & bug reports

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

Discord Channel

Acknowledgments

Python Software Foundation (PSF) grants Nava library from version 0.8 to 0.9. PSF is the organization behind Python. Their mission is to promote, protect, and advance the Python programming language and to support and facilitate the growth of a diverse and international community of Python programmers.

Python Software Foundation

Show your support

Star this repo

Give a ⭐️ if this project helped you!

Donate to our project

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 ;-) .

Nava Donation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

0.9 - 2026-09-02

Added

  • CLI tests
  • NavaThread._terminate_process method
  • --engine CLI argument

Changed

  • Python typing features added to all modules
  • CLI functions moved to cli.py
  • play_cli function modified
  • NavaThread.stop method updated
  • Dependencies structure modified
  • README.md updated
  • Test system modified

0.8 - 2025-12-17

Added

  • WinMM engine

Changed

  • Python 3.14 added to tests
  • run function in NavaThread updated
  • stop function in NavaThread updated
  • README.md updated
  • Test system modified
  • Python 3.6 support dropped
  • GitHub actions are limited to the dev and main branches

0.7 - 2024-10-23

Changed

  • Python 3.13 added to tests
  • engine parameter added to play function
  • engine parameter added to NavaThread class
  • README.md modified
  • Test system modified
  • NavaThread exception bug fixed
  • __play_win function renamed to __play_winsound
  • __play_mac function renamed to __play_afplay
  • __play_linux function renamed to __play_alsa

0.6 - 2024-06-05

Added

  • play_cli function
  • SECURITY.md

Changed

  • main function updated
  • OSs local checklist added to pull request template
  • Test system modified
  • README.md modified

0.5 - 2024-04-03

Changed

  • loop parameter added to play function
  • NavaThread class modified
  • README.md modified

0.4 - 2024-02-19

Added

  • feature_request.yml template
  • config.yml for issue template

Changed

  • Bug report template modified
  • NavaThread.stop method bug fixed
  • Test system modified
  • README.md modified

0.3 - 2024-01-31

Added

  • NavaThread class
  • stop function
  • stop_all function

Changed

  • async_mode parameter added to play function
  • Test system modified
  • README.md modified
  • Python 3.12 added to linux_test.yml, macOS_test.yml and windows_test.yml

0.2 - 2023-07-10

Added

  • Logo
  • Anaconda package

Changed

  • quote decorator bug fixed
  • path_check decorator bug fixed
  • Test system modified
  • README.md modified

0.1 - 2023-06-10

Added

  • README.md
  • __play_win function
  • __play_linux function
  • __play_mac function
  • quote function
  • path_check function
  • play function

Release files for nava 0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nava 0.9
File Size Uploaded
nava-0.9.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nava 0.9
File Interpreter ABI Platform
nava-0.9-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release history Release notifications | RSS feed

This release

0.9 This release

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page