Skip to content

Instantly share code, notes, and snippets.

@fjolublar
Last active July 1, 2020 08:41
Show Gist options
  • Save fjolublar/1e5d09ea08d0a002d828eb2fcc8798ef to your computer and use it in GitHub Desktop.
Save fjolublar/1e5d09ea08d0a002d828eb2fcc8798ef to your computer and use it in GitHub Desktop.
Working with interesting python libraries.
# Pretty Print.
from pprint import pprint
playsound #is the most straightforward package to use if you simply want to play a WAV or MP3 file. It offers no functionality other than simple playback.
simpleaudio #lets you play WAV files and NumPy arrays, and gives you options to check whether a file is still playing.
winsound #allows you to play WAV files or beep your speakers, but it works only on Windows.
python-sounddevice and pyaudio provide bindings #for the PortAudio library for cross-platform playback of WAV files.
pydub #requires pyaudio for audio playback, but with ffmpeg installed, it lets you play a large range of audio formats with only a few lines of code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment