nava


Namenava JSON
Version 0.5 PyPI version JSON
download
home_pagehttps://github.com/openscilab/nava
SummaryA Python library for playing sound everywhere natively and securely.
upload_time2024-04-03 04:19:52
maintainerNone
docs_urlNone
authorOpenSciLab Development Team
requires_python>=3.6
licenseMIT
keywords sound wav music mp3 player audio
VCS
bugtrack_url
requirements art
Travis-CI No Travis.
coveralls test coverage
            
<div align="center">
    <img src="https://github.com/openscilab/nava/raw/main/others/logo.png" width="300" height="300">
    <h1>Nava</h1>
    <br/>
    <a href="https://www.python.org/">
        <img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"/>
    </a>
    <a href="https://badge.fury.io/py/nava">
        <img src="https://badge.fury.io/py/nava.svg" alt="PyPI version" height="18">
    </a>
    <a href="https://anaconda.org/openscilab/nava">
	<img src="https://anaconda.org/openscilab/nava/badges/version.svg">
    </a>
    <a href="https://codecov.io/gh/openscilab/nava">
        <img src="https://codecov.io/gh/openscilab/nava/branch/main/graph/badge.svg" alt="Codecov">
    </a>
    <a href="https://discord.gg/MCbPKCFBs3">
        <img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel">
    </a>
</div>

## Overview

<p align="justify">
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.
</p>

<table>
	<tr>
		<td align="center">PyPI Counter</td>
		<td align="center">
            <a href="http://pepy.tech/project/nava">
                <img src="http://pepy.tech/badge/nava">
            </a>
        </td>
	</tr>
	<tr>
		<td align="center">Github Stars</td>
		<td align="center">
            <a href="https://github.com/openscilab/nava">
                <img src="https://img.shields.io/github/stars/openscilab/nava.svg?style=social&label=Stars">
            </a>
        </td>
	</tr>
</table>



<table>
	<tr> 
		<td align="center">Branch</td>
		<td align="center">main</td>
		<td align="center">dev</td>
	</tr>
    <tr>
		<td align="center">Linux CI</td>
		<td align="center"><img src="https://github.com/openscilab/nava/actions/workflows/linux_test.yml/badge.svg?branch=main"></td>
		<td align="center"><img src="https://github.com/openscilab/nava/actions/workflows/linux_test.yml/badge.svg?branch=dev"></td>
	</tr>
	<tr>
		<td align="center">Windows CI</td>
		<td align="center"><img src="https://github.com/openscilab/nava/actions/workflows/windows_test.yml/badge.svg?branch=main"></td>
		<td align="center"><img src="https://github.com/openscilab/nava/actions/workflows/windows_test.yml/badge.svg?branch=dev"></td>
	</tr>
	<tr>
		<td align="center">macOS CI</td>
		<td align="center"><img src="https://github.com/openscilab/nava/actions/workflows/macOS_test.yml/badge.svg?branch=main"></td>
		<td align="center"><img src="https://github.com/openscilab/nava/actions/workflows/macOS_test.yml/badge.svg?branch=dev"></td>
	</tr>
</table>

<table>
	<tr> 
		<td align="center">Code Quality</td>
		<td align="center"><a href="https://app.codacy.com/gh/openscilab/nava/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/9c384b4e400340ae94772c1d7e1842d0"></a></td>
		<td align="center"><a href="https://www.codefactor.io/repository/github/openscilab/nava"><img src="https://www.codefactor.io/repository/github/openscilab/nava/badge" alt="CodeFactor"></a></td>
		<td align="center"><a href="https://codebeat.co/projects/github-com-openscilab-nava-dev"><img alt="codebeat badge" src="https://codebeat.co/badges/75df9d9c-af95-4038-8a1d-9f3618856871"></a></td>
	</tr>
</table>

## Installation

### PyPI

- Check [Python Packaging User Guide](https://packaging.python.org/installing/)     
- Run `pip install nava==0.5`

### Source code
- Download [Version 0.5](https://github.com/openscilab/nava/archive/v0.5.zip) or [Latest Source](https://github.com/openscilab/nava/archive/dev.zip)
- Run `pip install .`

### Conda

- Check [Conda Managing Package](https://conda.io/)
- Update Conda using `conda update conda`
- Run `conda install -c openscilab nava`

## Usage

### Basic

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

### Async mode

⚠️ The `async_mode` parameter has a default value of `False`

```python
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`

```python
from nava import play, stop
sound_id = play("alarm.wav", async_mode=True, loop=True)
time.sleep(100)
stop(sound_id)
```

### Error

```python
from nava import play, NavaBaseError

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

## Engine

List of different platforms and the corresponding engines that are used for sound playing.

<table>
	<tr> 
		<th align="center">Platform</th>
		<th align="center">Engine</th>
		<th align="center">Supported Formats</th>
	</tr>
    <tr>
		<td align="center">Linux</td>
		<td align="center"><a href="https://www.alsa-project.org/wiki/Main_Page">Advanced Linux Sound Architecture</a></td>
		<td align="center"><code>.wav</code></td>
	</tr>
    <tr>
		<td align="center">Windows</td>
		<td align="center"><a href="https://docs.python.org/3/library/winsound.html">Winsound</a></td>
		<td align="center"><code>.wav</code></td>
	</tr>
    <tr>
		<td align="center">macOS</td>
		<td align="center"><a href="https://ss64.com/mac/afplay.html">Audio File Play</a></td>
		<td align="center"><code>.wav</code>,<code>.mp3</code></td>
	</tr>
</table>


## Issues & bug reports

Just fill an issue and describe it. We'll check it ASAP! or send an email to [info@openscilab.com](mailto:info@openscilab.com "info@openscilab.com").

- Please complete the issue template
 
You can also join our discord server

<a href="https://discord.gg/MCbPKCFBs3">
  <img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
</a>

## Show your support

<h3>Star this repo</h3>

Give a ⭐️ if this project helped you!

<h3>Donate to our project</h3>

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

<a href="https://openscilab.com/#donation" target="_blank"><img src="https://github.com/openscilab/nava/raw/main/others/donation.png" height="90px" width="270px" alt="Nava Donation"></a>

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

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [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


[Unreleased]: https://github.com/openscilab/nava/compare/v0.5...dev
[0.5]: https://github.com/openscilab/nava/compare/v0.4...v0.5
[0.4]: https://github.com/openscilab/nava/compare/v0.3...v0.4
[0.3]: https://github.com/openscilab/nava/compare/v0.2...v0.3
[0.2]: https://github.com/openscilab/nava/compare/v0.1...v0.2
[0.1]: https://github.com/openscilab/nava/compare/bd789cc...v0.1

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openscilab/nava",
    "name": "nava",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "sound wav music mp3 player audio",
    "author": "OpenSciLab Development Team",
    "author_email": "info@openscilab.com",
    "download_url": "https://files.pythonhosted.org/packages/45/32/e5d9e4867436289511ee00950db4048dd3282709b7a54653d376559379aa/nava-0.5.tar.gz",
    "platform": null,
    "description": "\n<div align=\"center\">\n    <img src=\"https://github.com/openscilab/nava/raw/main/others/logo.png\" width=\"300\" height=\"300\">\n    <h1>Nava</h1>\n    <br/>\n    <a href=\"https://www.python.org/\">\n        <img src=\"https://img.shields.io/badge/built%20with-Python3-green.svg\" alt=\"built with Python3\"/>\n    </a>\n    <a href=\"https://badge.fury.io/py/nava\">\n        <img src=\"https://badge.fury.io/py/nava.svg\" alt=\"PyPI version\" height=\"18\">\n    </a>\n    <a href=\"https://anaconda.org/openscilab/nava\">\n\t<img src=\"https://anaconda.org/openscilab/nava/badges/version.svg\">\n    </a>\n    <a href=\"https://codecov.io/gh/openscilab/nava\">\n        <img src=\"https://codecov.io/gh/openscilab/nava/branch/main/graph/badge.svg\" alt=\"Codecov\">\n    </a>\n    <a href=\"https://discord.gg/MCbPKCFBs3\">\n        <img src=\"https://img.shields.io/discord/1064533716615049236.svg\" alt=\"Discord Channel\">\n    </a>\n</div>\n\n## Overview\n\n<p align=\"justify\">\nNava 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.\n</p>\n\n<table>\n\t<tr>\n\t\t<td align=\"center\">PyPI Counter</td>\n\t\t<td align=\"center\">\n            <a href=\"http://pepy.tech/project/nava\">\n                <img src=\"http://pepy.tech/badge/nava\">\n            </a>\n        </td>\n\t</tr>\n\t<tr>\n\t\t<td align=\"center\">Github Stars</td>\n\t\t<td align=\"center\">\n            <a href=\"https://github.com/openscilab/nava\">\n                <img src=\"https://img.shields.io/github/stars/openscilab/nava.svg?style=social&label=Stars\">\n            </a>\n        </td>\n\t</tr>\n</table>\n\n\n\n<table>\n\t<tr> \n\t\t<td align=\"center\">Branch</td>\n\t\t<td align=\"center\">main</td>\n\t\t<td align=\"center\">dev</td>\n\t</tr>\n    <tr>\n\t\t<td align=\"center\">Linux CI</td>\n\t\t<td align=\"center\"><img src=\"https://github.com/openscilab/nava/actions/workflows/linux_test.yml/badge.svg?branch=main\"></td>\n\t\t<td align=\"center\"><img src=\"https://github.com/openscilab/nava/actions/workflows/linux_test.yml/badge.svg?branch=dev\"></td>\n\t</tr>\n\t<tr>\n\t\t<td align=\"center\">Windows CI</td>\n\t\t<td align=\"center\"><img src=\"https://github.com/openscilab/nava/actions/workflows/windows_test.yml/badge.svg?branch=main\"></td>\n\t\t<td align=\"center\"><img src=\"https://github.com/openscilab/nava/actions/workflows/windows_test.yml/badge.svg?branch=dev\"></td>\n\t</tr>\n\t<tr>\n\t\t<td align=\"center\">macOS CI</td>\n\t\t<td align=\"center\"><img src=\"https://github.com/openscilab/nava/actions/workflows/macOS_test.yml/badge.svg?branch=main\"></td>\n\t\t<td align=\"center\"><img src=\"https://github.com/openscilab/nava/actions/workflows/macOS_test.yml/badge.svg?branch=dev\"></td>\n\t</tr>\n</table>\n\n<table>\n\t<tr> \n\t\t<td align=\"center\">Code Quality</td>\n\t\t<td align=\"center\"><a href=\"https://app.codacy.com/gh/openscilab/nava/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade\"><img src=\"https://app.codacy.com/project/badge/Grade/9c384b4e400340ae94772c1d7e1842d0\"></a></td>\n\t\t<td align=\"center\"><a href=\"https://www.codefactor.io/repository/github/openscilab/nava\"><img src=\"https://www.codefactor.io/repository/github/openscilab/nava/badge\" alt=\"CodeFactor\"></a></td>\n\t\t<td align=\"center\"><a href=\"https://codebeat.co/projects/github-com-openscilab-nava-dev\"><img alt=\"codebeat badge\" src=\"https://codebeat.co/badges/75df9d9c-af95-4038-8a1d-9f3618856871\"></a></td>\n\t</tr>\n</table>\n\n## Installation\n\n### PyPI\n\n- Check [Python Packaging User Guide](https://packaging.python.org/installing/)     \n- Run `pip install nava==0.5`\n\n### Source code\n- Download [Version 0.5](https://github.com/openscilab/nava/archive/v0.5.zip) or [Latest Source](https://github.com/openscilab/nava/archive/dev.zip)\n- Run `pip install .`\n\n### Conda\n\n- Check [Conda Managing Package](https://conda.io/)\n- Update Conda using `conda update conda`\n- Run `conda install -c openscilab nava`\n\n## Usage\n\n### Basic\n\n```python\nfrom nava import play\nplay(\"alarm.wav\")\n```\n\n### Async mode\n\n\u26a0\ufe0f The `async_mode` parameter has a default value of `False`\n\n```python\nimport time\nfrom nava import play, stop\nsound_id = play(\"alarm.wav\", async_mode=True)\ntime.sleep(4)\nstop(sound_id)\n```\n\n### Loop mode\n\n\u26a0\ufe0f The `loop` parameter has a default value of `False`\n\u26a0\ufe0f You should always set `async_mode` flag when you are using `loop`\n\n```python\nfrom nava import play, stop\nsound_id = play(\"alarm.wav\", async_mode=True, loop=True)\ntime.sleep(100)\nstop(sound_id)\n```\n\n### Error\n\n```python\nfrom nava import play, NavaBaseError\n\ntry:\n    play(\"alarm.wav\")\nexcept NavaBaseError as e:\n    print(str(e))\n```\n\n## Engine\n\nList of different platforms and the corresponding engines that are used for sound playing.\n\n<table>\n\t<tr> \n\t\t<th align=\"center\">Platform</th>\n\t\t<th align=\"center\">Engine</th>\n\t\t<th align=\"center\">Supported Formats</th>\n\t</tr>\n    <tr>\n\t\t<td align=\"center\">Linux</td>\n\t\t<td align=\"center\"><a href=\"https://www.alsa-project.org/wiki/Main_Page\">Advanced Linux Sound Architecture</a></td>\n\t\t<td align=\"center\"><code>.wav</code></td>\n\t</tr>\n    <tr>\n\t\t<td align=\"center\">Windows</td>\n\t\t<td align=\"center\"><a href=\"https://docs.python.org/3/library/winsound.html\">Winsound</a></td>\n\t\t<td align=\"center\"><code>.wav</code></td>\n\t</tr>\n    <tr>\n\t\t<td align=\"center\">macOS</td>\n\t\t<td align=\"center\"><a href=\"https://ss64.com/mac/afplay.html\">Audio File Play</a></td>\n\t\t<td align=\"center\"><code>.wav</code>,<code>.mp3</code></td>\n\t</tr>\n</table>\n\n\n## Issues & bug reports\n\nJust fill an issue and describe it. We'll check it ASAP! or send an email to [info@openscilab.com](mailto:info@openscilab.com \"info@openscilab.com\").\n\n- Please complete the issue template\n \nYou can also join our discord server\n\n<a href=\"https://discord.gg/MCbPKCFBs3\">\n  <img src=\"https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge\" alt=\"Discord Channel\">\n</a>\n\n## Show your support\n\n<h3>Star this repo</h3>\n\nGive a \u2b50\ufe0f if this project helped you!\n\n<h3>Donate to our project</h3>\n\nIf 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 ;-) .\n\n<a href=\"https://openscilab.com/#donation\" target=\"_blank\"><img src=\"https://github.com/openscilab/nava/raw/main/others/donation.png\" height=\"90px\" width=\"270px\" alt=\"Nava Donation\"></a>\n\n# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)\nand this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n## [0.5] - 2024-04-03\n### Changed\n- `loop` parameter added to `play` function\n- `NavaThread` class modified\n- `README.md` modified\n## [0.4] - 2024-02-19\n### Added\n- `feature_request.yml` template\n- `config.yml` for issue template\n### Changed\n- Bug report template modified\n- `NavaThread.stop` method bug fixed\n- Test system modified\n- `README.md` modified \n## [0.3] - 2024-01-31\n### Added\n- `NavaThread` class\n- `stop` function\n- `stop_all` function\n### Changed\n- `async_mode` parameter added to `play` function\n- Test system modified\n- `README.md` modified \n- `Python 3.12` added to `linux_test.yml`, `macOS_test.yml` and `windows_test.yml`\n## [0.2] - 2023-07-10\n### Added\n- Logo\n- Anaconda package\n### Changed\n- `quote` decorator bug fixed\n- `path_check` decorator bug fixed\n- Test system modified\n- `README.md` modified \n## [0.1] - 2023-06-10\n### Added\n- `README.md`\n- `__play_win` function\n- `__play_linux` function\n- `__play_mac` function\n- `quote` function\n- `path_check` function\n- `play` function\n\n\n[Unreleased]: https://github.com/openscilab/nava/compare/v0.5...dev\n[0.5]: https://github.com/openscilab/nava/compare/v0.4...v0.5\n[0.4]: https://github.com/openscilab/nava/compare/v0.3...v0.4\n[0.3]: https://github.com/openscilab/nava/compare/v0.2...v0.3\n[0.2]: https://github.com/openscilab/nava/compare/v0.1...v0.2\n[0.1]: https://github.com/openscilab/nava/compare/bd789cc...v0.1\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for playing sound everywhere natively and securely.",
    "version": "0.5",
    "project_urls": {
        "Discord": "https://discord.gg/MCbPKCFBs3",
        "Download": "https://github.com/openscilab/nava/tarball/v0.5",
        "Homepage": "https://github.com/openscilab/nava",
        "Source": "https://github.com/openscilab/nava",
        "Webpage": "https://openscilab.com/"
    },
    "split_keywords": [
        "sound",
        "wav",
        "music",
        "mp3",
        "player",
        "audio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "25d5de3344537f76cdd473ff2a2d1588febd1bcff69bdc936d8274c5698199f4",
                "md5": "9d12ae699ef0ff5b9a0cd1420e27e9f1",
                "sha256": "7719fbee5c7a1fe32a5d11637a0890a8c159abd746fbe12dd34a2eeee2d97b17"
            },
            "downloads": -1,
            "filename": "nava-0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9d12ae699ef0ff5b9a0cd1420e27e9f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9075,
            "upload_time": "2024-04-03T04:19:53",
            "upload_time_iso_8601": "2024-04-03T04:19:53.950755Z",
            "url": "https://files.pythonhosted.org/packages/25/d5/de3344537f76cdd473ff2a2d1588febd1bcff69bdc936d8274c5698199f4/nava-0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4532e5d9e4867436289511ee00950db4048dd3282709b7a54653d376559379aa",
                "md5": "acd4145b64cf9ed69643a720e2a1667b",
                "sha256": "e3a36c0f3aea180ca4a5cc681a50688241fd4fd6419bc81f626d7e7de1efc626"
            },
            "downloads": -1,
            "filename": "nava-0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "acd4145b64cf9ed69643a720e2a1667b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10524,
            "upload_time": "2024-04-03T04:19:52",
            "upload_time_iso_8601": "2024-04-03T04:19:52.304803Z",
            "url": "https://files.pythonhosted.org/packages/45/32/e5d9e4867436289511ee00950db4048dd3282709b7a54653d376559379aa/nava-0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-03 04:19:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openscilab",
    "github_project": "nava",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "art",
            "specs": [
                [
                    ">=",
                    "1.8"
                ]
            ]
        }
    ],
    "lcname": "nava"
}
        
Elapsed time: 0.23410s