Skip to main content

Generate a variety of white/brown/pink noises good for relaxation

Project description

image image Build status

Soothing Sounds Generator

An acoustically pleasing Python code, targeted initially for Raspberry Pi, but should run almost anywhere. Uses lightweight, pure Python 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.

Install

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

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.)
    ffmpeg -f s16le -ar 16000 -ac 1 -i pink.raw pink.fla
    

Notes

The core noise generation code is almost entirely from Python Acoustics

optional high performance Python FFTW install:

sudo apt-get install libfftw3-dev

Optional PyAudio

  • Linux: apt install portaudio19-dev libjack-dev libjack0
  • Mac: brew install portaudio

and then:

pip install pyaudio

Optional Pygame

Pick one of the following methods to install pygame

pip

simplest way for PCs, but may require compiling for ARM CPU:

pip install pygame

Linux distro

For ARM CPU, this is the best choice generally for PyGame.

apt install python-pygame

compile Pygame via pip

Usually you don't want to bother with this

apt install mercurial libflac-dev libmad0-dev libmikmod2-dev libogg-dev libportmidi-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libvorbis-dev libwebp-dev libwebpdemux1 sharutils libswscale-dev libavformat-dev

pip install hg+http://bitbucket.org/pygame/pygame


cd /tmp

hg clone http://bitbucket.org/pygame/pygame

cd /tmp/pygame

python setup.py build

python setup.py install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

soothingsounds-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

soothingsounds-1.0.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file soothingsounds-1.0.0.tar.gz.

File metadata

File hashes

Hashes for soothingsounds-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2baadcdd611a5c1913262f96771d060a4ef14d4ee61d2fe6aff0ef4ea7b70626
MD5 91ef1abaf8d1a2dc5b784bf16932a4a4
BLAKE2b-256 dfeecc2829c9c37ed33fef45b7420c4ef7be6be938210c60b9c9c6eb51759d44

See more details on using hashes here.

File details

Details for the file soothingsounds-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for soothingsounds-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 add7591f42547c8e6ab728764510d910a5584cff3b1d02c399680d26508c364f
MD5 3678c6be66b9b4f72bc18b7116e59dcd
BLAKE2b-256 19ea02738851c14f53d10a8fadbef6e1d7f0b2c9502d63eee5dad9207bc204f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page