Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Demo several ways of making sound from Numpy arrays in Python, white noise

License

NotificationsYou must be signed in to change notification settings

scivision/soothing-sounds

Repository files navigation

DOIPyPi Download stats

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

pip install -e.

Usage

The noisecolor 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 fromPython Acoustics

optional high performance Python FFTW install:

apt install libfftw3-dev

[8]ページ先頭

©2009-2025 Movatter.jp