Custom module to play .wav file in python
- Discord: Okane 🎴#1273
- Twitter: @Okaneeeeeeeee_e
- Github: Okaneeee
- Project link: soundPlayer
threading
for multi-threadingwave
for parsing & opening WAVE filepyaudio
for PortAudio supports & audio streams
soundPlayer.py
Main class to play .wav fileFileExtensionException
Subclass in soundPlayer to handle extension errors
Download requirements.txt
Install requirements: pip install -r requirements.txt
Download the file soundPlayer.py
and put it in the directory where you want to use it
from soundPlayer import SoundPlayer
sound = 'path_to_wav_file'
player = SoundPlayer(sound)
# Play a sound:
player.play()
# Stop the sound being played
player.close()
All the musics used for testing were done by Kevin MacLeod and are under the Creative Commons licenses.
Check LICENSE.md