Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scivision/soothing-sounds
Demo several ways of making sound from Numpy arrays in Python, white noise
https://github.com/scivision/soothing-sounds
brown-noise pink-noise sleep-research white-noise
Last synced: 14 days ago
JSON representation
Demo several ways of making sound from Numpy arrays in Python, white noise
- Host: GitHub
- URL: https://github.com/scivision/soothing-sounds
- Owner: scivision
- License: apache-2.0
- Created: 2015-12-30T06:09:41.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T06:38:48.000Z (about 3 years ago)
- Last Synced: 2024-07-08T01:43:00.909Z (4 months ago)
- Topics: brown-noise, pink-noise, sleep-research, white-noise
- Language: Python
- Homepage:
- Size: 92.8 KB
- Stars: 31
- Watchers: 5
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Soothing Sounds Generator
[![DOI](https://zenodo.org/badge/48785075.svg)](https://zenodo.org/badge/latestdoi/48785075)
[![PyPi Download stats](http://pepy.tech/badge/soothingsounds)](http://pepy.tech/project/soothingsounds)An acoustically pleasing Python code, targeted initially for Raspberry Pi, but should run almost anywhere.
Uses lightweight, pure Python
[SoundDevice](https://pypi.org/project/sounddevice/)
to generate sounds.
Optionally, other sound playback Python packages can be used.I have used the outputs of this program written to SD cards, played on media players in multiple locations for a few years.
```sh
pip install -e .
```## Usage
The noise `color` option is one of
> white pink blue violet brown
the examples will use pink noise.
### Play sound from speakers
```sh
python soothing.py pink
```### save sound to disk
1. generate raw sound file: `python soothing.py pink -o pink.raw`
2. convert raw to lossless FLAC (playable in almost all media players, computer, phone etc.)
```bash
ffmpeg -f s16le -ar 16000 -ac 1 -i pink.raw pink.fla
```
## NotesThe core noise generation code is almost entirely from
[Python Acoustics](https://github.com/python-acoustics/python-acoustics)### optional high performance Python FFTW install:
```sh
apt install libfftw3-dev
```