Package: pyrilla
Windows buildMac OS X buildpyrillapyrilla is a self-contained statically linked binding togorilla-audiolibrary -
“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 singlepip install pyrillacommand. It is built with cython and its API is
inspired by part of great but unmantainedbacongame engine.It works without any problems on OS X, Windows, and Linux. Officially
supported Python versions are py27, py33, py34, py35.pyrilla on PyPI and supported systemsPyrilla 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, OS X, and Linux. Its extensive built
pipeline targets different system flavours (32/64bit) and different
Python versions. On supported systems it can be easily instaled with
pip:pip install pyrillaMost up-to-date list of provided distributions is available on pyrilla’sproject page on PyPI.
Depending on target platform the underlying Gorilla Audio library is
compiled with slightly different settings:Target platformAvailable Python versionsAudio backendArchWindowspy27, py33, py34, py35XAudio2Win32/Win64Mac OS Xpy27, py33, py34, py35OpenALintel/x86_64Linuxpy27, py33, py34, py35OpenALx86_64/i686 (32bit)If you really need support for other platform or more Python versions
then fill issue on GitHub repository for this project so I can
prioritize my work. I don’t want to spend my time on providing more
distributions not knowing if anyone really needs them.Note: Linux wheels for pyrilla on PyPI are portable Linux build
distributions (i.e.manylinux1) as described byPEP
513.Source distribution (sdist) for pyrilla available on PyPI is still a 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 inbuildingsection 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.usageThe easiest way to play single sound is to useSoundclass:frompyrillaimportcoredeffinished(sound):print("sound%sfinished playing"%sound)quit()# note: sound file extension must be explicitely providedsound=core.Sound("soundfile.ogg","ogg")# optional callback will be called when sound finishes to playsound.play(finished)whileTrue:# 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 useVoiceinstance that can be
created from existing sound.frompyrillaimportcoresound=core.Sound("soundfile.ogg","ogg")voice=core.Voice(sound,loop=True)voice.play()whileTrue:core.update()For more features like custom managers/mixers, voice control (pitch,
gain, pan) or stop/play see code samples inexamplesdirectory of
this repo.buildingBuilding pyrilla prerequisites:cythoncmakemakeIf 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 (undergorilla-audiodirectory). You need to eaither clone
this repository with--recursiveGit flag or init submodules
manually:git submodule update --init --recursiveUse cmake to build build gorilla-audiocmake gorilla-audio/build
cmake --build . --config Release
python setup.py buildFor 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 installNote 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