Skip to main content

Python binding to gorilla-audio library

Project description

Windows build

Mac OS X build

Build status

Build Status

pyrilla

pyrilla is a self-contained statically linked binding to gorilla-audio library - “an attempt to make a free, straightforward, cross-platform, high-level software audio mixer that supports playback of both static and streaming sounds”. Like the original it is intended for video game development.

pyrilla’s goal is to provide a python audio package that can be installed without any external dependencies with single pip install pyrilla command. It is built with cython and its API is inspired by part of great but unmantained bacon game engine.

It works without any problems under Mac OS X and Windows. Linux support is planned in a near future.

pyrilla on PyPI

Pyrilla is wrapper on Gorilla Audio C library that is statically linked during installation. For developers convenience it is distributed on PyPI as binary wheels for Windows and Mac OS X. On Windows and Mac OS X it can be easily instaled with pip:

pip install pyrilla

Most up-to-date list of provided distributions is available on pyrilla’s project page on PyPI. Depending on target platform the underlying Gorilla Audio library is compiled with slightly different settings:

Target platform

Available Python versions

Audio backend

Arch

Windows

py27, py33, py34, py35

XAudio2

32bit

Mac OS X

py27

OpenAL

32bit

64 bit builds for x64 Python versions are not supported yet because I did not manage to compile libvorbis version bundled with Gorilla Audio under x64 compiler yet.

If you really need support for other platform (64bit, Linux, whatever) or more Python versions then fill issue on GitHub repository for this project so I can prioritize my work. I don’t want to spent my time on providing more distributions not knwowing if anyone really needs them.

Note that there is no way to provide binary wheels for Linux platform at the moment and pyrilla source distribution (sdist) available on PyPI is still bit broken. Generally it is not supposed to compile on Linux. This is going to change in future. If you want to use pyrilla on Linux you need to build it by yourself on your platform. The process is preety straightforward and described in building section of this README.

Last but not least, there is also some support for cygwin. Unfortunately there is no binary wheel on PyPI for this environment yet. If you want to use pyrilla under cygwin then you need to compile it manually.

usage

The easiest way to play single sound is to use Sound class:

from pyrilla import core

def finished(sound):
    print("sound %s finished playing" % sound)
    quit()


# note: sound file extension must be explicitely provided
sound = core.Sound("soundfile.ogg", "ogg")
# optional callback will be called when sound finishes to play
sound.play(finished)

while True:
    # update internal state of default audio manager and mixer
    # this mixes all currently played sounds, pushes buffers etc.
    core.update()

To play looped audio you need to use Voice instance that can be created from existing sound.

from pyrilla import core

sound = core.Sound("soundfile.ogg", "ogg")
voice = core.Voice(sound, loop=True)
voice.play()

while True:
    core.update()

For more features like custom managers/mixers, voice control (pitch, gain, pan) or stop/play see code samples in examples directory of this repo.

building

Building pyrilla prerequisites:

  • cython

  • cmake

  • make

If you are going to build this package then remeber that Gorilla Audio is bundled with this repository as Git submodule from my unofficial fork on GitHub (under gorilla-audio directory). You need to eaither clone this repository with --recursive Git flag or init submodules manually:

git submodule update --init --recursive

Use cmake to build build gorilla-audio

cmake gorilla-audio/build
cmake --build . --config Release
python setup.py build

For windows (also on cygwin):

cmake -DENABLE_OPENAL:STRING=0 -DENABLE_XAUDIO2:STRING=1 -DENABLE_DIRECTSOUND:STRING=0 .
cmake --config Release --build .

Then build and install the python extension:

python setup.py build
python setup.py install

Note that building for Windows may be bit trickier. If your personal environment is broken and compilation step for Gorilla Audio does not find the correct path for DirectX SDK and/or XAudio2 lib file. If you have same problems as I have then you probably need to provide this path manually to first cmake call:

-DDIRECTX_XAUDIO2_LIBRARY=path/to/the/DirectXSdk/Lib/x86/xapobase.lib

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyrilla-0.0.1.win32.zip (110.0 kB view details)

Uploaded Source

pyrilla-0.0.1-cp35-cp35m-win32.whl (113.2 kB view details)

Uploaded CPython 3.5m Windows x86

pyrilla-0.0.1-cp35-cp35m-macosx_10_9_x86_64.whl (175.0 kB view details)

Uploaded CPython 3.5m macOS 10.9+ x86-64

pyrilla-0.0.1-cp34-cp34m-win32.whl (116.6 kB view details)

Uploaded CPython 3.4m Windows x86

pyrilla-0.0.1-cp34-cp34m-macosx_10_9_x86_64.whl (175.0 kB view details)

Uploaded CPython 3.4m macOS 10.9+ x86-64

pyrilla-0.0.1-cp33-none-win32.whl (116.6 kB view details)

Uploaded CPython 3.3 Windows x86

pyrilla-0.0.1-cp33-cp33m-macosx_10_9_x86_64.whl (174.9 kB view details)

Uploaded CPython 3.3m macOS 10.9+ x86-64

pyrilla-0.0.1-cp27-none-win32.whl (110.5 kB view details)

Uploaded CPython 2.7 Windows x86

pyrilla-0.0.1-cp27-none-macosx_10_10_intel.whl (203.6 kB view details)

Uploaded CPython 2.7 macOS 10.10+ intel

pyrilla-0.0.1-cp27-cp27m-win32.whl (116.4 kB view details)

Uploaded CPython 2.7m Windows x86

pyrilla-0.0.1-cp27-cp27m-macosx_10_9_intel.whl (194.5 kB view details)

Uploaded CPython 2.7m macOS 10.9+ intel

File details

Details for the file pyrilla-0.0.1.win32.zip.

File metadata

  • Download URL: pyrilla-0.0.1.win32.zip
  • Upload date:
  • Size: 110.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyrilla-0.0.1.win32.zip
Algorithm Hash digest
SHA256 a3b0b9198f60675dca450394146de526e9d2d1b8c10558a47b4906d7aea824c2
MD5 dd307b318932c6ba30732b701d71ede2
BLAKE2b-256 eae310aa29913aeea444297e51d753d85d59a1912e559ccccbcadf442221bdbd

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 7eb939bb1644dfca22323700b474c9b622a05744e0f0beb5d5b676488022eba5
MD5 b524037f4bc8950436ae4a5f5feadfa3
BLAKE2b-256 27b18d09102e9a1cd5550e86ce2a4368090fd5f8955da952f3dd5aaa52e10a98

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp35-cp35m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f394e15edf2c5204e8c1027dd50e95a976399111de9c668f2c50bb8a78677317
MD5 3c04c1758f7c607238bb83413dbbb6a7
BLAKE2b-256 aadf2996e66ba6a2fe0f189c7ca4cd41ea304dab1fdde26877cedfff7e89a7fb

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 e0a04b8a6bb86c225f49921551574f2788b37ec0624f6566bf12873e6e8db3bd
MD5 7fc1ea034cd6147f15f116721f333ee5
BLAKE2b-256 9c215a4a2bac9f6a066b321f631d9abedad87a43ac2a8b1cb8cca814b1de9595

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp34-cp34m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp34-cp34m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7ed7502b81aa498a74e125494d55ed201b15c72a5e97d30af94d1a47602e426c
MD5 89e9365bd1ccab19b66eb2a0acd6fc98
BLAKE2b-256 b49e9d62f502a66688a77453438a2e848d7f68f7d61193744e7b934a3dd84a1c

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp33-none-win32.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp33-none-win32.whl
Algorithm Hash digest
SHA256 018df1e96d06702a33c9816b78b83a1d1e0d57835700d4846bcdadb73157608d
MD5 b33e4943439a873c2f9c501e3b29bada
BLAKE2b-256 82d414364b1faf9097eac9ec8b2c29cbccf55dbd5f232aabd5353b651d1a52a1

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp33-cp33m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp33-cp33m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6101c45b57207b61b6067b5ca66b473e9e17171cfd6549e80f3433f640a389bf
MD5 a365734f64ca6087673dac29034b6628
BLAKE2b-256 672a86325231dbefb9e63f7bf77a3d4b7c0dd851c621cf97c57bf428ab6eceb9

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp27-none-win32.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp27-none-win32.whl
Algorithm Hash digest
SHA256 fc1a481aed53ee412bdf54e335340db5222d0d600923d641e659d432e0894c70
MD5 6d4672057faf7520ea490deae5c31c96
BLAKE2b-256 50659d9a0ac36e7ea7c433c0a4bd70d122f43f6435bb297ee4f6c9cdf46e422a

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp27-none-macosx_10_10_intel.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp27-none-macosx_10_10_intel.whl
Algorithm Hash digest
SHA256 387f5e80b46bf90fece36b2ca6981c94f970afb10a49e914b69cfc1e0d748661
MD5 02a3400a687664d100eefaf48e0cd86d
BLAKE2b-256 9dc15361a71dc5ebccee6d3cb4665d7b4f1d9e3ff56d266f9e206f6ddc6c8a09

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0ba54d8365f68455137548166f41eaa043577cf40de153c66fd694502dff785f
MD5 8c62bf988bc43e27bb4e2ea5c27552b5
BLAKE2b-256 db0d0ed99cfb362bf96d0adfa69621d5125bb77df652fd8f3a707c0dc65c6004

See more details on using hashes here.

File details

Details for the file pyrilla-0.0.1-cp27-cp27m-macosx_10_9_intel.whl.

File metadata

File hashes

Hashes for pyrilla-0.0.1-cp27-cp27m-macosx_10_9_intel.whl
Algorithm Hash digest
SHA256 75e7f026a2484543db98d9503d1be51eae4ea5c5b6d6feb39a77356bdf34f30b
MD5 557349a06d64070da3032bfc2662a726
BLAKE2b-256 ad1e9c74d1fcb92a4ede9c1b50bd42614efdf8956cdbd34657aabf644c8723d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page