Skip to content

Repository files navigation

python-ffmpegio-example-audioplayer

A set of example Python scripts to use ffmpegio for audio playback, interfacing with various audio player packages.

simpleaudio_player.py

This script plays a test file using simpleaudio package's play_buffer() function.

The ffmpegio's stream reader populates the shared bytearray buffer incrementally as simpleaudio plays the buffer

pyaudio_player.py

This script plays a test file using pyaudio package's [callback IO mode] (https://people.csail.mit.edu/hubert/pyaudio/docs/#example-callback-mode-audio-i-o).

The pyaudio stream's callback function calls the read() function of the ffmpegio's stream reader.

Bonus

testfile_generator.py ^^^^^^^^^^^^^^^^^^^^^^^

Generate random test audio files (tone or noise) with ffmpegio.transcode() and ffmpegio.FilterGraph. The data is generated by FFmpeg's aevalsrc filter

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages