gustaebel / pyxaudio

Basic Cython bindings for FFmpeg, Pulseaudio and Alsa

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyxaudio

Abstract

pyxaudio provides audio support for Python on Linux. Audio processing is done using the FFmpeg library, Pulseaudio and Alsa can be used for playback. pyxaudio is intentionally kept basic and simple.

Dependencies

The version numbers merely reflect which versions I have been using during development.

Example

import sys
import pyxaudio

# Open the playback sink.
sink = pyxaudio.Sink()

for url in sys.argv[1:]:
    if sys.version_info.major == 2:
        # pyxaudio needs all strings as unicode objects.
        url = url.decode(sys.getfilesystemencoding())

    # Create a new decoding source for the url.
    source = pyxaudio.Source(url)

    # Configure the sink.
    sink.setup(source)

    while True:
        buf = source.read(8192)
        if not buf:
            break
        sink.write(buf)

    # Clean up.
    source.close()
sink.close()

About

Basic Cython bindings for FFmpeg, Pulseaudio and Alsa

License:GNU General Public License v2.0


Languages

Language:Cython 71.1%Language:Python 28.9%