Split the reference into multiple pages

This commit is contained in:
Nguyễn Gia Phong 2020-05-21 22:17:35 +07:00
parent fa513ea096
commit a0b4a90f79
75 changed files with 4051 additions and 2935 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -130,7 +130,7 @@ to improve the CI/CD may find it helpful.
Play around with it for a little to make sure that everything is OK.
#. Under the local repository, checkout the ``gh-pages`` branch.
Often, is it necessary to update the credits under the :doc:`copying`
section and review if the :doc:`reference` section needs any change
section and review if the :doc:`reference/index` section needs any change
before running ``make html`` to rebuild to documentation.
#. View the documentation locally then push it to GitHub.

View File

@ -9,6 +9,7 @@ to fix or remove the issue.
License
-------
Palace is free software: you can redistribute it and/or modify it
under the terms of the `GNU Lesser General Public License`_
as published by the Free Software Foundation, either version 3

View File

@ -1,6 +1,8 @@
Design Principles
=================
.. currentmodule:: palace
In this section, we will discuss a few design principles in order to write
a safe, efficient, easy-to-use and extendable 3D audio library for Python,
by wrapping existing functionalities from the C++ API alure_.
@ -128,7 +130,7 @@ as it is equivalent to
Other than closure/destruction of objects, typical uses of `context managers`__
also include saving and restoring various kinds of global state (as seen in
:py:class:`palace.Context`), locking and unlocking resources, etc.
:py:class:`Context`), locking and unlocking resources, etc.
__ https://docs.python.org/3/reference/datamodel.html#context-managers
@ -173,7 +175,7 @@ from ``BaseDecoder`` will be exposed to C++ as an attribute of ``CppDecoder``.
Effectively, this means the users can have the alure API calling their
inherited Python object as naturally as if palace is implemented in pure Python.
In practice, :py:class:`palace.BaseDecoder` will also need to take into account
In practice, :py:class:`BaseDecoder` will also need to take into account
other guarding mechanisms like :py:class:`abc.ABC`. Due to Cython limitations,
implementation as a pure Python class and :ref:`aliasing <getter-setter>` of
``@getter``/``@setter`` should be considered.

View File

@ -1,29 +1,38 @@
Welcome to our palace!
======================
Overview
========
Pythonic Audio Library and Codecs Environment provides common higher-level API
for audio rendering using OpenAL. It wraps around the C++ interface alure_
for 3D positional rendering, environmental effects and out-of-the-box
codec support, while using Cython to provide a modern interface with
type hinting, data descriptors, context managers and ``snake_case``
for a safe, convenient and pleasurable experience.
for audio rendering using OpenAL:
* 3D positional rendering, with HRTF_ support for stereo systems
* Environmental effects: reverb, atmospheric air absorption,
sound occlusion and obstruction
* Out-of-the-box codec support:
Palace wraps around the C++ interface alure_ using Cython_ for a safe and
convenient interface with type hinting, data descriptors and context managers,
following :pep:`8#naming-conventions` (``PascalCase.snake_case``).
Table of Contents
-----------------
.. toctree::
:maxdepth: 2
installation
tutorial/index
reference
reference/index
design
contributing
copying
Indices and tables
==================
Indices and Tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. _HRTF: https://en.wikipedia.org/wiki/Head-related_transfer_function
.. _alure: https://github.com/kcat/alure
.. _Cython: https://cython.org

View File

@ -1,178 +0,0 @@
Reference
=========
.. currentmodule:: palace
Audio Devices
-------------
.. data:: device_names
:type: DeviceNames
Read-only namespace of device names by category (``basic``, ``full`` and
``capture``), as tuples of strings whose first item being the default.
.. autofunction:: query_extension
.. autoclass:: Device
:members:
Audio Library Contexts
----------------------
.. data:: CHANNEL_CONFIG
:type: int
Context creation key to specify the channel configuration
(either ``MONO``, ``STEREO``, ``QUAD``, ``X51``, ``X61`` or ``X71``).
.. data:: SAMPLE_TYPE
:type: int
Context creation key to specify the sample type
(either ``[UNSIGNED_]{BYTE,SHORT,INT}`` or ``FLOAT``).
.. data:: FREQUENCY
:type: int
Context creation key to specify the frequency in hertz.
.. data:: MONO_SOURCES
:type: int
Context creation key to specify the number of mono (3D) sources.
.. data:: STEREO_SOURCES
:type: int
Context creation key to specify the number of stereo sources.
.. data:: MAX_AUXILIARY_SENDS
:type: int
Context creation key to specify the maximum number of
auxiliary source sends.
.. data:: HRTF
:type: int
Context creation key to specify whether to enable HRTF
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: HRTF_ID
:type: int
Context creation key to specify the HRTF to be used.
.. data:: OUTPUT_LIMITER
:type: int
Context creation key to specify whether to use a gain limiter
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: distance_models
:type: Tuple[str, ...]
Names of available distance models.
.. autofunction:: thread_local
.. autofunction:: current_context
.. autofunction:: use_context
.. autoclass:: Context
:members:
.. autoclass:: Listener
:members:
.. autoclass:: MessageHandler
:members:
Resource Caching
----------------
.. autofunction:: cache
.. autofunction:: free
.. autoclass:: Buffer
:members:
Sources & Source Groups
-----------------------
.. autoclass:: Source
:members:
.. autoclass:: SourceGroup
:members:
Environmental Effects
---------------------
For the sake of brevity, we only document the constraints of each effect's
properties. Further details can be found at OpenAL's `Effect Extension Guide`_
which specifies the purpose and usage of each value.
.. data:: reverb_preset_names
:type: Tuple[str, ...]
Names of predefined reverb effect presets in lexicographical order.
.. autoclass:: BaseEffect
:members:
.. autoclass:: ReverbEffect
:members:
.. autoclass:: ChorusEffect
:members:
Decoder Interface
-----------------
.. data:: sample_types
:type: Tuple[str, ...]
Names of available sample types.
.. data:: channel_configs
:type: Tuple[str, ...]
Names of available channel configurations.
.. data:: decoder_factories
:type: DecoderNamespace
Simple object for storing decoder factories.
User-registered factories are tried one after another
if :py:exc:`RuntimeError` is raised, in lexicographical order.
Internal decoder factories are always used after registered ones.
.. autofunction:: decode
.. autofunction:: sample_size
.. autofunction:: sample_length
.. autoclass:: Decoder
:members:
.. autoclass:: BaseDecoder
:members:
File I/O Interface
------------------
.. autofunction:: current_fileio
.. autofunction:: use_fileio
.. autoclass:: FileIO
:members:
.. _Effect Extension Guide:
https://kcat.strangesoft.net/misc-downloads/Effects%20Extension%20Guide.pdf

View File

@ -0,0 +1,17 @@
Resource Caching
================
.. currentmodule:: palace
Audio Buffers
-------------
.. autoclass:: Buffer
:members:
Loading & Freeing in Batch
--------------------------
.. autofunction:: cache
.. autofunction:: free

View File

@ -0,0 +1,83 @@
Audio Library Contexts
======================
.. currentmodule:: palace
Context and Auxiliary Classes
-----------------------------
.. autoclass:: Context
:members:
.. autoclass:: Listener
:members:
.. autoclass:: MessageHandler
:members:
Using Contexts
--------------
.. autofunction:: use_context
.. autofunction:: current_context
.. autofunction:: thread_local
Context Creation Attributes
---------------------------
.. data:: CHANNEL_CONFIG
:type: int
Context creation key to specify the channel configuration
(either ``MONO``, ``STEREO``, ``QUAD``, ``X51``, ``X61`` or ``X71``).
.. data:: SAMPLE_TYPE
:type: int
Context creation key to specify the sample type
(either ``[UNSIGNED_]{BYTE,SHORT,INT}`` or ``FLOAT``).
.. data:: FREQUENCY
:type: int
Context creation key to specify the frequency in hertz.
.. data:: MONO_SOURCES
:type: int
Context creation key to specify the number of mono (3D) sources.
.. data:: STEREO_SOURCES
:type: int
Context creation key to specify the number of stereo sources.
.. data:: MAX_AUXILIARY_SENDS
:type: int
Context creation key to specify the maximum number of
auxiliary source sends.
.. data:: HRTF
:type: int
Context creation key to specify whether to enable HRTF
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: HRTF_ID
:type: int
Context creation key to specify the HRTF to be used.
.. data:: OUTPUT_LIMITER
:type: int
Context creation key to specify whether to use a gain limiter
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: distance_models
:type: Tuple[str, ...]
Names of available distance models.

View File

@ -0,0 +1,44 @@
Audio Streams
=============
.. currentmodule:: palace
Builtin Decoders
----------------
.. autoclass:: Decoder
:members:
Decoder Interface
-----------------
.. data:: decoder_factories
:type: DecoderNamespace
Simple object for storing decoder factories.
User-registered factories are tried one after another
if :py:exc:`RuntimeError` is raised, in lexicographical order.
Internal decoder factories are always used after registered ones.
.. autofunction:: decode
.. autoclass:: BaseDecoder
:members:
Miscellaneous
-------------
.. data:: sample_types
:type: Tuple[str, ...]
Names of available sample types.
.. data:: channel_configs
:type: Tuple[str, ...]
Names of available channel configurations.
.. autofunction:: sample_size
.. autofunction:: sample_length

View File

@ -0,0 +1,21 @@
Audio Devices
=============
.. currentmodule:: palace
Device-Dependent Utilities
--------------------------
.. autoclass:: Device
:members:
Device-Independent Utilities
----------------------------
.. data:: device_names
:type: DeviceNames
Read-only namespace of device names by category (``basic``, ``full`` and
``capture``), as tuples of strings whose first item being the default.
.. autofunction:: query_extension

View File

@ -0,0 +1,34 @@
Environmental Effects
=====================
.. currentmodule:: palace
For the sake of brevity, we only document the constraints of each effect's
properties. Further details can be found at OpenAL's `Effect Extension Guide`_
which specifies the purpose and usage of each value.
Base Effect
-----------
.. autoclass:: BaseEffect
:members:
Chorus Effect
-------------
.. autoclass:: ChorusEffect
:members:
Reverb Effect
-------------
.. data:: reverb_preset_names
:type: Tuple[str, ...]
Names of predefined reverb effect presets in lexicographical order.
.. autoclass:: ReverbEffect
:members:
.. _Effect Extension Guide:
https://kcat.strangesoft.net/misc-downloads/Effects%20Extension%20Guide.pdf

View File

@ -0,0 +1,11 @@
File I/O Interface
==================
.. currentmodule:: palace
.. autofunction:: current_fileio
.. autofunction:: use_fileio
.. autoclass:: FileIO
:members:

View File

@ -0,0 +1,14 @@
Reference
=========
API reference is divided into the following sections:
.. toctree::
device
context
buffer
source
effect
decoder
file-io

View File

@ -0,0 +1,16 @@
Sources & Source Groups
=======================
.. currentmodule:: palace
Sources
-------
.. autoclass:: Source
:members:
Source Groups
-------------
.. autoclass:: SourceGroup
:members:

View File

@ -1,16 +0,0 @@
Tutorial
========
This tutorial will guide you on:
.. toctree::
:maxdepth: 1
tutorial/context
tutorial/play-audio
.. comment these to add later
Moving sources
Adding effects
Customize decoder
Generate sounds
..

View File

@ -1,8 +1,8 @@
.. py:currentmodule:: palace
Context Creation
================
.. currentmodule:: palace
A context is an object that allows palace to access OpenAL,
which is essential when you work with palace. Context maintains
the audio environment and contains environment settings and components

View File

@ -1,8 +1,8 @@
.. py:currentmodule:: palace
Play an Audio
=============
.. currentmodule:: palace
Now that you know how to create a context,
let's get into the most essential use case: playing audio.

View File

@ -31,7 +31,7 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Getting Involved</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#reporting-a-bug">Reporting a Bug</a></li>
@ -67,6 +67,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
@ -231,7 +237,7 @@ to build the wheels and publish them to PyPI.</p></li>
Play around with it for a little to make sure that everything is OK.</p></li>
<li><p>Under the local repository, checkout the <code class="docutils literal notranslate"><span class="pre">gh-pages</span></code> branch.
Often, is it necessary to update the credits under the <a class="reference internal" href="copying.html"><span class="doc">Copying</span></a>
section and review if the <a class="reference internal" href="reference.html"><span class="doc">Reference</span></a> section needs any change
section and review if the <a class="reference internal" href="reference/index.html"><span class="doc">Reference</span></a> section needs any change
before running <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">html</span></code> to rebuild to documentation.</p></li>
<li><p>View the documentation locally then push it to GitHub.</p></li>
</ol>

View File

@ -30,7 +30,7 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Getting Involved</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Copying</a><ul>
@ -63,6 +63,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>

View File

@ -15,7 +15,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Getting Involved" href="contributing.html" />
<link rel="prev" title="Reference" href="reference.html" />
<link rel="prev" title="File I/O Interface" href="reference/file-io.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
@ -31,7 +31,7 @@
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Design Principles</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#the-impl-idiom">The Impl Idiom</a></li>
<li class="toctree-l2"><a class="reference internal" href="#the-modern-python">The Modern Python</a></li>
@ -65,6 +65,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
@ -86,7 +92,7 @@
<ul>
<li>
&larr;
<a href="reference.html" title="Previous document">Reference</a>
<a href="reference/file-io.html" title="Previous document">File I/O Interface</a>
</li>
<li>
<a href="contributing.html" title="Next document">Getting Involved</a>
@ -206,7 +212,7 @@ will be closed, regardless of whatever may happen within the inner block</p>
</div>
<p>Other than closure/destruction of objects, typical uses of <a class="reference external" href="https://docs.python.org/3/reference/datamodel.html#context-managers">context managers</a>
also include saving and restoring various kinds of global state (as seen in
<a class="reference internal" href="reference.html#palace.Context" title="palace.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">palace.Context</span></code></a>), locking and unlocking resources, etc.</p>
<a class="reference internal" href="reference/context.html#palace.Context" title="palace.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a>), locking and unlocking resources, etc.</p>
</div>
</div>
<div class="section" id="the-double-reference">
@ -244,7 +250,7 @@ although well need to handle the reference count ourselves, e.g.</p>
from <code class="docutils literal notranslate"><span class="pre">BaseDecoder</span></code> will be exposed to C++ as an attribute of <code class="docutils literal notranslate"><span class="pre">CppDecoder</span></code>.
Effectively, this means the users can have the alure API calling their
inherited Python object as naturally as if palace is implemented in pure Python.</p>
<p>In practice, <a class="reference internal" href="reference.html#palace.BaseDecoder" title="palace.BaseDecoder"><code class="xref py py-class docutils literal notranslate"><span class="pre">palace.BaseDecoder</span></code></a> will also need to take into account
<p>In practice, <a class="reference internal" href="reference/decoder.html#palace.BaseDecoder" title="palace.BaseDecoder"><code class="xref py py-class docutils literal notranslate"><span class="pre">BaseDecoder</span></code></a> will also need to take into account
other guarding mechanisms like <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code>. Due to Cython limitations,
implementation as a pure Python class and <a class="reference internal" href="#getter-setter"><span class="std std-ref">aliasing</span></a> of
<code class="docutils literal notranslate"><span class="pre">&#64;getter</span></code>/<code class="docutils literal notranslate"><span class="pre">&#64;setter</span></code> should be considered.</p>
@ -259,7 +265,7 @@ implementation as a pure Python class and <a class="reference internal" href="#g
<ul>
<li>
&larr;
<a href="reference.html" title="Previous document">Reference</a>
<a href="reference/file-io.html" title="Previous document">File I/O Interface</a>
</li>
<li>
<a href="contributing.html" title="Next document">Getting Involved</a>

View File

@ -30,7 +30,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="copying.html">Copying</a></li>
@ -59,6 +59,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
@ -115,17 +121,17 @@
<h2 id="A">A</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Source.air_absorption_factor">air_absorption_factor (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.air_absorption_factor">air_absorption_factor (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.air_absorption_gain_hf">air_absorption_gain_hf (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.air_absorption_gain_hf">air_absorption_gain_hf (palace.ReverbEffect attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device.alc_version">alc_version() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.alc_version">alc_version() (palace.Device property)</a>
</li>
<li><a href="reference.html#palace.Context.async_wake_interval">async_wake_interval (palace.Context attribute)</a>
<li><a href="reference/context.html#palace.Context.async_wake_interval">async_wake_interval (palace.Context attribute)</a>
</li>
<li><a href="reference.html#palace.Context.available_resamplers">available_resamplers() (palace.Context property)</a>
<li><a href="reference/context.html#palace.Context.available_resamplers">available_resamplers() (palace.Context property)</a>
</li>
</ul></td>
</tr></table>
@ -133,17 +139,17 @@
<h2 id="B">B</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.BaseDecoder">BaseDecoder (class in palace)</a>
<li><a href="reference/decoder.html#palace.BaseDecoder">BaseDecoder (class in palace)</a>
</li>
<li><a href="reference.html#palace.BaseEffect">BaseEffect (class in palace)</a>
<li><a href="reference/effect.html#palace.BaseEffect">BaseEffect (class in palace)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device.basic_name">basic_name() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.basic_name">basic_name() (palace.Device property)</a>
</li>
<li><a href="reference.html#palace.Buffer">Buffer (class in palace)</a>
<li><a href="reference/buffer.html#palace.Buffer">Buffer (class in palace)</a>
</li>
<li><a href="reference.html#palace.MessageHandler.buffer_loading">buffer_loading() (palace.MessageHandler method)</a>
<li><a href="reference/context.html#palace.MessageHandler.buffer_loading">buffer_loading() (palace.MessageHandler method)</a>
</li>
</ul></td>
</tr></table>
@ -151,41 +157,41 @@
<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.cache">cache() (in module palace)</a>
<li><a href="reference/buffer.html#palace.cache">cache() (in module palace)</a>
</li>
<li><a href="reference.html#palace.CHANNEL_CONFIG">CHANNEL_CONFIG (in module palace)</a>
<li><a href="reference/context.html#palace.CHANNEL_CONFIG">CHANNEL_CONFIG (in module palace)</a>
</li>
<li><a href="reference.html#palace.BaseDecoder.channel_config">channel_config() (palace.BaseDecoder property)</a>
<li><a href="reference/decoder.html#palace.BaseDecoder.channel_config">channel_config() (palace.BaseDecoder property)</a>
<ul>
<li><a href="reference.html#palace.Buffer.channel_config">(palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.channel_config">(palace.Buffer property)</a>
</li>
<li><a href="reference.html#palace.Decoder.channel_config">(palace.Decoder property)</a>
<li><a href="reference/decoder.html#palace.Decoder.channel_config">(palace.Decoder property)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.channel_configs">channel_configs (in module palace)</a>
<li><a href="reference/decoder.html#palace.channel_configs">channel_configs (in module palace)</a>
</li>
<li><a href="reference.html#palace.ChorusEffect">ChorusEffect (class in palace)</a>
<li><a href="reference/effect.html#palace.ChorusEffect">ChorusEffect (class in palace)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device.clock_time">clock_time() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.clock_time">clock_time() (palace.Device property)</a>
</li>
<li><a href="reference.html#palace.Device.close">close() (palace.Device method)</a>
<li><a href="reference/device.html#palace.Device.close">close() (palace.Device method)</a>
<ul>
<li><a href="reference.html#palace.FileIO.close">(palace.FileIO method)</a>
<li><a href="reference/file-io.html#palace.FileIO.close">(palace.FileIO method)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.Source.cone_angles">cone_angles (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.cone_angles">cone_angles (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.Context">Context (class in palace)</a>
<li><a href="reference/context.html#palace.Context">Context (class in palace)</a>
</li>
<li><a href="reference.html#palace.current_context">current_context() (in module palace)</a>
<li><a href="reference/context.html#palace.current_context">current_context() (in module palace)</a>
</li>
<li><a href="reference.html#palace.current_fileio">current_fileio() (in module palace)</a>
<li><a href="reference/file-io.html#palace.current_fileio">current_fileio() (in module palace)</a>
</li>
<li><a href="reference.html#palace.Device.current_hrtf">current_hrtf() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.current_hrtf">current_hrtf() (palace.Device property)</a>
</li>
</ul></td>
</tr></table>
@ -193,59 +199,61 @@
<h2 id="D">D</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.ReverbEffect.decay_hf_limit">decay_hf_limit (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.decay_hf_limit">decay_hf_limit (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.decay_hf_ratio">decay_hf_ratio (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.decay_hf_ratio">decay_hf_ratio (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.decay_lf_ratio">decay_lf_ratio (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.decay_lf_ratio">decay_lf_ratio (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.decay_time">decay_time (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.decay_time">decay_time (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.decode">decode() (in module palace)</a>
<li><a href="reference/decoder.html#palace.decode">decode() (in module palace)</a>
</li>
<li><a href="reference.html#palace.Decoder">Decoder (class in palace)</a>
<li><a href="reference/decoder.html#palace.Decoder">Decoder (class in palace)</a>
</li>
<li><a href="reference.html#palace.decoder_factories">decoder_factories (in module palace)</a>
<li><a href="reference/decoder.html#palace.decoder_factories">decoder_factories (in module palace)</a>
</li>
<li><a href="reference.html#palace.Context.default_resampler_index">default_resampler_index() (palace.Context property)</a>
<li><a href="reference/context.html#palace.Context.default_resampler_index">default_resampler_index() (palace.Context property)</a>
</li>
<li><a href="reference.html#palace.ChorusEffect.delay">delay (palace.ChorusEffect attribute)</a>
<li><a href="reference/effect.html#palace.ChorusEffect.delay">delay (palace.ChorusEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.density">density (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.density">density (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ChorusEffect.depth">depth (palace.ChorusEffect attribute)</a>
<li><a href="reference/effect.html#palace.ChorusEffect.depth">depth (palace.ChorusEffect attribute)</a>
</li>
<li><a href="reference.html#palace.BaseEffect.destroy">destroy() (palace.BaseEffect method)</a>
<li><a href="reference/effect.html#palace.BaseEffect.destroy">destroy() (palace.BaseEffect method)</a>
<ul>
<li><a href="reference.html#palace.Buffer.destroy">(palace.Buffer method)</a>
<li><a href="reference/buffer.html#palace.Buffer.destroy">(palace.Buffer method)</a>
</li>
<li><a href="reference.html#palace.Context.destroy">(palace.Context method)</a>
<li><a href="reference/context.html#palace.Context.destroy">(palace.Context method)</a>
</li>
<li><a href="reference.html#palace.Source.destroy">(palace.Source method)</a>
<li><a href="reference/source.html#palace.Source.destroy">(palace.Source method)</a>
</li>
<li><a href="reference.html#palace.SourceGroup.destroy">(palace.SourceGroup method)</a>
<li><a href="reference/source.html#palace.SourceGroup.destroy">(palace.SourceGroup method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device">Device (class in palace)</a>
<li><a href="reference/device.html#palace.Device">Device (class in palace)</a>
</li>
<li><a href="reference.html#palace.MessageHandler.device_disconnected">device_disconnected() (palace.MessageHandler method)</a>
<li><a href="reference/context.html#palace.Context.device">device (palace.Context attribute)</a>
</li>
<li><a href="reference.html#palace.device_names">device_names (in module palace)</a>
<li><a href="reference/context.html#palace.MessageHandler.device_disconnected">device_disconnected() (palace.MessageHandler method)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.diffusion">diffusion (palace.ReverbEffect attribute)</a>
<li><a href="reference/device.html#palace.device_names">device_names (in module palace)</a>
</li>
<li><a href="reference.html#palace.Context.distance_model">distance_model() (palace.Context property)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.diffusion">diffusion (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.distance_models">distance_models (in module palace)</a>
<li><a href="reference/context.html#palace.Context.distance_model">distance_model() (palace.Context property)</a>
</li>
<li><a href="reference.html#palace.Source.distance_range">distance_range (palace.Source attribute)</a>
<li><a href="reference/context.html#palace.distance_models">distance_models (in module palace)</a>
</li>
<li><a href="reference.html#palace.Source.doppler_factor">doppler_factor (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.distance_range">distance_range (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.Context.doppler_factor">doppler_factor() (palace.Context property)</a>
<li><a href="reference/source.html#palace.Source.doppler_factor">doppler_factor (palace.Source attribute)</a>
</li>
<li><a href="reference/context.html#palace.Context.doppler_factor">doppler_factor() (palace.Context property)</a>
</li>
</ul></td>
</tr></table>
@ -253,15 +261,15 @@
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.ReverbEffect.echo_depth">echo_depth (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.echo_depth">echo_depth (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.echo_time">echo_time (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.echo_time">echo_time (palace.ReverbEffect attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device.efx_version">efx_version() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.efx_version">efx_version() (palace.Device property)</a>
</li>
<li><a href="reference.html#palace.Context.end_batch">end_batch() (palace.Context method)</a>
<li><a href="reference/context.html#palace.Context.end_batch">end_batch() (palace.Context method)</a>
</li>
</ul></td>
</tr></table>
@ -269,31 +277,31 @@
<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Source.fade_out_to_stop">fade_out_to_stop() (palace.Source method)</a>
<li><a href="reference/source.html#palace.Source.fade_out_to_stop">fade_out_to_stop() (palace.Source method)</a>
</li>
<li><a href="reference.html#palace.ChorusEffect.feedback">feedback (palace.ChorusEffect attribute)</a>
<li><a href="reference/effect.html#palace.ChorusEffect.feedback">feedback (palace.ChorusEffect attribute)</a>
</li>
<li><a href="reference.html#palace.FileIO">FileIO (class in palace)</a>
<li><a href="reference/file-io.html#palace.FileIO">FileIO (class in palace)</a>
</li>
<li><a href="reference.html#palace.Source.filter">filter() (palace.Source property)</a>
<li><a href="reference/source.html#palace.Source.filter">filter() (palace.Source property)</a>
</li>
<li><a href="reference.html#palace.free">free() (in module palace)</a>
<li><a href="reference/buffer.html#palace.free">free() (in module palace)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.FREQUENCY">FREQUENCY (in module palace)</a>
<li><a href="reference/context.html#palace.FREQUENCY">FREQUENCY (in module palace)</a>
</li>
<li><a href="reference.html#palace.BaseDecoder.frequency">frequency() (palace.BaseDecoder property)</a>
<li><a href="reference/decoder.html#palace.BaseDecoder.frequency">frequency() (palace.BaseDecoder property)</a>
<ul>
<li><a href="reference.html#palace.Buffer.frequency">(palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.frequency">(palace.Buffer property)</a>
</li>
<li><a href="reference.html#palace.Decoder.frequency">(palace.Decoder property)</a>
<li><a href="reference/decoder.html#palace.Decoder.frequency">(palace.Decoder property)</a>
</li>
<li><a href="reference.html#palace.Device.frequency">(palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.frequency">(palace.Device property)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.Buffer.from_decoder">from_decoder() (palace.Buffer static method)</a>
<li><a href="reference/buffer.html#palace.Buffer.from_decoder">from_decoder() (palace.Buffer static method)</a>
</li>
</ul></td>
</tr></table>
@ -301,27 +309,27 @@
<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.ReverbEffect.gain">gain (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.gain">gain (palace.ReverbEffect attribute)</a>
<ul>
<li><a href="reference.html#palace.Source.gain">(palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.gain">(palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.SourceGroup.gain">(palace.SourceGroup attribute)</a>
<li><a href="reference/source.html#palace.SourceGroup.gain">(palace.SourceGroup attribute)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.Listener.gain">gain() (palace.Listener property)</a>
<li><a href="reference/context.html#palace.Listener.gain">gain() (palace.Listener property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Source.gain_auto">gain_auto (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.gain_auto">gain_auto (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.gain_hf">gain_hf (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.gain_hf">gain_hf (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.gain_lf">gain_lf (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.gain_lf">gain_lf (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.Source.gain_range">gain_range (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.gain_range">gain_range (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.Source.group">group (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.group">group (palace.Source attribute)</a>
</li>
</ul></td>
</tr></table>
@ -329,17 +337,17 @@
<h2 id="H">H</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.ReverbEffect.hf_reference">hf_reference (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.hf_reference">hf_reference (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.HRTF">HRTF (in module palace)</a>
<li><a href="reference/context.html#palace.HRTF">HRTF (in module palace)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device.hrtf_enabled">hrtf_enabled() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.hrtf_enabled">hrtf_enabled() (palace.Device property)</a>
</li>
<li><a href="reference.html#palace.HRTF_ID">HRTF_ID (in module palace)</a>
<li><a href="reference/context.html#palace.HRTF_ID">HRTF_ID (in module palace)</a>
</li>
<li><a href="reference.html#palace.Device.hrtf_names">hrtf_names() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.hrtf_names">hrtf_names() (palace.Device property)</a>
</li>
</ul></td>
</tr></table>
@ -347,7 +355,7 @@
<h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Context.is_supported">is_supported() (palace.Context method)</a>
<li><a href="reference/context.html#palace.Context.is_supported">is_supported() (palace.Context method)</a>
</li>
</ul></td>
</tr></table>
@ -355,45 +363,47 @@
<h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.ReverbEffect.late_reverb_delay">late_reverb_delay (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.late_reverb_delay">late_reverb_delay (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.late_reverb_gain">late_reverb_gain (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.late_reverb_gain">late_reverb_gain (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.late_reverb_pan">late_reverb_pan (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.late_reverb_pan">late_reverb_pan (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.Source.latency">latency() (palace.Source property)</a>
<li><a href="reference/source.html#palace.Source.latency">latency() (palace.Source property)</a>
</li>
<li><a href="reference.html#palace.Source.latency_seconds">latency_seconds() (palace.Source property)</a>
<li><a href="reference/source.html#palace.Source.latency_seconds">latency_seconds() (palace.Source property)</a>
</li>
<li><a href="reference.html#palace.BaseDecoder.length">length() (palace.BaseDecoder property)</a>
<li><a href="reference/decoder.html#palace.BaseDecoder.length">length() (palace.BaseDecoder property)</a>
<ul>
<li><a href="reference.html#palace.Buffer.length">(palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.length">(palace.Buffer property)</a>
</li>
<li><a href="reference.html#palace.Decoder.length">(palace.Decoder property)</a>
<li><a href="reference/decoder.html#palace.Decoder.length">(palace.Decoder property)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Buffer.length_seconds">length_seconds() (palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.length_seconds">length_seconds() (palace.Buffer property)</a>
<ul>
<li><a href="reference.html#palace.Decoder.length_seconds">(palace.Decoder property)</a>
<li><a href="reference/decoder.html#palace.Decoder.length_seconds">(palace.Decoder property)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.ReverbEffect.lf_reference">lf_reference (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.lf_reference">lf_reference (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.Listener">Listener (class in palace)</a>
<li><a href="reference/context.html#palace.Listener">Listener (class in palace)</a>
</li>
<li><a href="reference.html#palace.Buffer.loop_points">loop_points (palace.Buffer attribute)</a>
<li><a href="reference/context.html#palace.Context.listener">listener (palace.Context attribute)</a>
</li>
<li><a href="reference.html#palace.BaseDecoder.loop_points">loop_points() (palace.BaseDecoder property)</a>
<li><a href="reference/buffer.html#palace.Buffer.loop_points">loop_points (palace.Buffer attribute)</a>
</li>
<li><a href="reference/decoder.html#palace.BaseDecoder.loop_points">loop_points() (palace.BaseDecoder property)</a>
<ul>
<li><a href="reference.html#palace.Decoder.loop_points">(palace.Decoder property)</a>
<li><a href="reference/decoder.html#palace.Decoder.loop_points">(palace.Decoder property)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.Source.looping">looping (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.looping">looping (palace.Source attribute)</a>
</li>
</ul></td>
</tr></table>
@ -401,23 +411,23 @@
<h2 id="M">M</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.MAX_AUXILIARY_SENDS">MAX_AUXILIARY_SENDS (in module palace)</a>
<li><a href="reference/context.html#palace.MAX_AUXILIARY_SENDS">MAX_AUXILIARY_SENDS (in module palace)</a>
</li>
<li><a href="reference.html#palace.Device.max_auxiliary_sends">max_auxiliary_sends() (palace.Device property)</a>
<li><a href="reference/device.html#palace.Device.max_auxiliary_sends">max_auxiliary_sends() (palace.Device property)</a>
</li>
<li><a href="reference.html#palace.Context.message_handler">message_handler (palace.Context attribute)</a>
<li><a href="reference/context.html#palace.Context.message_handler">message_handler (palace.Context attribute)</a>
</li>
<li><a href="reference.html#palace.MessageHandler">MessageHandler (class in palace)</a>
<li><a href="reference/context.html#palace.MessageHandler">MessageHandler (class in palace)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Listener.meters_per_unit">meters_per_unit() (palace.Listener property)</a>
<li><a href="reference/context.html#palace.Listener.meters_per_unit">meters_per_unit() (palace.Listener property)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.modulation_depth">modulation_depth (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.modulation_depth">modulation_depth (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.modulation_time">modulation_time (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.modulation_time">modulation_time (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.MONO_SOURCES">MONO_SOURCES (in module palace)</a>
<li><a href="reference/context.html#palace.MONO_SOURCES">MONO_SOURCES (in module palace)</a>
</li>
</ul></td>
</tr></table>
@ -425,7 +435,11 @@
<h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device.name">name() (palace.Device property)</a>
<li><a href="reference/buffer.html#palace.Buffer.name">name (palace.Buffer attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference/device.html#palace.Device.name">name() (palace.Device property)</a>
</li>
</ul></td>
</tr></table>
@ -433,19 +447,19 @@
<h2 id="O">O</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Source.offset">offset (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.offset">offset (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.Source.offset_seconds">offset_seconds() (palace.Source property)</a>
<li><a href="reference/source.html#palace.Source.offset_seconds">offset_seconds() (palace.Source property)</a>
</li>
<li><a href="reference.html#palace.Source.orientation">orientation (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.orientation">orientation (palace.Source attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Listener.orientation">orientation() (palace.Listener property)</a>
<li><a href="reference/context.html#palace.Listener.orientation">orientation() (palace.Listener property)</a>
</li>
<li><a href="reference.html#palace.Source.outer_cone_gains">outer_cone_gains (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.outer_cone_gains">outer_cone_gains (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.OUTPUT_LIMITER">OUTPUT_LIMITER (in module palace)</a>
<li><a href="reference/context.html#palace.OUTPUT_LIMITER">OUTPUT_LIMITER (in module palace)</a>
</li>
</ul></td>
</tr></table>
@ -453,39 +467,39 @@
<h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.SourceGroup.parent_group">parent_group (palace.SourceGroup attribute)</a>
<li><a href="reference/source.html#palace.SourceGroup.parent_group">parent_group (palace.SourceGroup attribute)</a>
</li>
<li><a href="reference.html#palace.Source.pause">pause() (palace.Source method)</a>
<li><a href="reference/source.html#palace.Source.pause">pause() (palace.Source method)</a>
</li>
<li><a href="reference.html#palace.SourceGroup.pause_all">pause_all() (palace.SourceGroup method)</a>
<li><a href="reference/source.html#palace.SourceGroup.pause_all">pause_all() (palace.SourceGroup method)</a>
</li>
<li><a href="reference.html#palace.Device.pause_dsp">pause_dsp() (palace.Device method)</a>
<li><a href="reference/device.html#palace.Device.pause_dsp">pause_dsp() (palace.Device method)</a>
</li>
<li><a href="reference.html#palace.Source.paused">paused() (palace.Source property)</a>
<li><a href="reference/source.html#palace.Source.paused">paused() (palace.Source property)</a>
</li>
<li><a href="reference.html#palace.ChorusEffect.phase">phase (palace.ChorusEffect attribute)</a>
<li><a href="reference/effect.html#palace.ChorusEffect.phase">phase (palace.ChorusEffect attribute)</a>
</li>
<li><a href="reference.html#palace.Source.pitch">pitch (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.pitch">pitch (palace.Source attribute)</a>
<ul>
<li><a href="reference.html#palace.SourceGroup.pitch">(palace.SourceGroup attribute)</a>
<li><a href="reference/source.html#palace.SourceGroup.pitch">(palace.SourceGroup attribute)</a>
</li>
</ul></li>
<li><a href="reference/buffer.html#palace.Buffer.play">play() (palace.Buffer method)</a>
<ul>
<li><a href="reference/decoder.html#palace.Decoder.play">(palace.Decoder method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Buffer.play">play() (palace.Buffer method)</a>
<ul>
<li><a href="reference.html#palace.Decoder.play">(palace.Decoder method)</a>
<li><a href="reference/source.html#palace.Source.playing">playing() (palace.Source property)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.Source.playing">playing() (palace.Source property)</a>
<li><a href="reference/source.html#palace.Source.position">position (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.Source.position">position (palace.Source attribute)</a>
<li><a href="reference/context.html#palace.Listener.position">position() (palace.Listener property)</a>
</li>
<li><a href="reference.html#palace.Listener.position">position() (palace.Listener property)</a>
</li>
<li><a href="reference.html#palace.Source.priority">priority (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.priority">priority (palace.Source attribute)</a>
</li>
<li>
Python Enhancement Proposals
@ -494,6 +508,8 @@
<li><a href="contributing.html#index-1">PEP 257</a>
</li>
<li><a href="contributing.html#index-0">PEP 8</a>
</li>
<li><a href="index.html#index-0">PEP 8#naming-conventions</a>
</li>
</ul></li>
</ul></td>
@ -502,10 +518,10 @@
<h2 id="Q">Q</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.query_extension">query_extension() (in module palace)</a>
<li><a href="reference/device.html#palace.query_extension">query_extension() (in module palace)</a>
<ul>
<li><a href="reference.html#palace.Device.query_extension">(palace.Device method)</a>
<li><a href="reference/device.html#palace.Device.query_extension">(palace.Device method)</a>
</li>
</ul></li>
</ul></td>
@ -514,45 +530,45 @@
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Source.radius">radius (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.radius">radius (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.BaseDecoder.read">read() (palace.BaseDecoder method)</a>
<li><a href="reference/decoder.html#palace.BaseDecoder.read">read() (palace.BaseDecoder method)</a>
<ul>
<li><a href="reference.html#palace.Decoder.read">(palace.Decoder method)</a>
<li><a href="reference/decoder.html#palace.Decoder.read">(palace.Decoder method)</a>
</li>
<li><a href="reference.html#palace.FileIO.read">(palace.FileIO method)</a>
<li><a href="reference/file-io.html#palace.FileIO.read">(palace.FileIO method)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.ReverbEffect.reflections_delay">reflections_delay (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.reflections_delay">reflections_delay (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.reflections_gain">reflections_gain (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.reflections_gain">reflections_gain (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.reflections_pan">reflections_pan (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.reflections_pan">reflections_pan (palace.ReverbEffect attribute)</a>
</li>
<li><a href="reference.html#palace.Source.relative">relative (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.relative">relative (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.Source.resampler_index">resampler_index (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.resampler_index">resampler_index (palace.Source attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Device.reset">reset() (palace.Device method)</a>
<li><a href="reference/device.html#palace.Device.reset">reset() (palace.Device method)</a>
</li>
<li><a href="reference.html#palace.MessageHandler.resource_not_found">resource_not_found() (palace.MessageHandler method)</a>
<li><a href="reference/context.html#palace.MessageHandler.resource_not_found">resource_not_found() (palace.MessageHandler method)</a>
</li>
<li><a href="reference.html#palace.Source.resume">resume() (palace.Source method)</a>
<li><a href="reference/source.html#palace.Source.resume">resume() (palace.Source method)</a>
</li>
<li><a href="reference.html#palace.SourceGroup.resume_all">resume_all() (palace.SourceGroup method)</a>
<li><a href="reference/source.html#palace.SourceGroup.resume_all">resume_all() (palace.SourceGroup method)</a>
</li>
<li><a href="reference.html#palace.Device.resume_dsp">resume_dsp() (palace.Device method)</a>
<li><a href="reference/device.html#palace.Device.resume_dsp">resume_dsp() (palace.Device method)</a>
</li>
<li><a href="reference.html#palace.reverb_preset_names">reverb_preset_names (in module palace)</a>
<li><a href="reference/effect.html#palace.reverb_preset_names">reverb_preset_names (in module palace)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect">ReverbEffect (class in palace)</a>
<li><a href="reference/effect.html#palace.ReverbEffect">ReverbEffect (class in palace)</a>
</li>
<li><a href="reference.html#palace.Source.rolloff_factors">rolloff_factors (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.rolloff_factors">rolloff_factors (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.ReverbEffect.room_rolloff_factor">room_rolloff_factor (palace.ReverbEffect attribute)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.room_rolloff_factor">room_rolloff_factor (palace.ReverbEffect attribute)</a>
</li>
</ul></td>
</tr></table>
@ -560,73 +576,73 @@
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.sample_length">sample_length() (in module palace)</a>
<li><a href="reference/decoder.html#palace.sample_length">sample_length() (in module palace)</a>
</li>
<li><a href="reference.html#palace.sample_size">sample_size() (in module palace)</a>
<li><a href="reference/decoder.html#palace.sample_size">sample_size() (in module palace)</a>
</li>
<li><a href="reference.html#palace.SAMPLE_TYPE">SAMPLE_TYPE (in module palace)</a>
<li><a href="reference/context.html#palace.SAMPLE_TYPE">SAMPLE_TYPE (in module palace)</a>
</li>
<li><a href="reference.html#palace.BaseDecoder.sample_type">sample_type() (palace.BaseDecoder property)</a>
<li><a href="reference/decoder.html#palace.BaseDecoder.sample_type">sample_type() (palace.BaseDecoder property)</a>
<ul>
<li><a href="reference.html#palace.Buffer.sample_type">(palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.sample_type">(palace.Buffer property)</a>
</li>
<li><a href="reference.html#palace.Decoder.sample_type">(palace.Decoder property)</a>
<li><a href="reference/decoder.html#palace.Decoder.sample_type">(palace.Decoder property)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.sample_types">sample_types (in module palace)</a>
<li><a href="reference/decoder.html#palace.sample_types">sample_types (in module palace)</a>
</li>
<li><a href="reference.html#palace.BaseDecoder.seek">seek() (palace.BaseDecoder method)</a>
<li><a href="reference/decoder.html#palace.BaseDecoder.seek">seek() (palace.BaseDecoder method)</a>
<ul>
<li><a href="reference.html#palace.Decoder.seek">(palace.Decoder method)</a>
<li><a href="reference/decoder.html#palace.Decoder.seek">(palace.Decoder method)</a>
</li>
<li><a href="reference.html#palace.FileIO.seek">(palace.FileIO method)</a>
<li><a href="reference/file-io.html#palace.FileIO.seek">(palace.FileIO method)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.ReverbEffect.send_auto">send_auto() (palace.ReverbEffect property)</a>
<li><a href="reference/effect.html#palace.ReverbEffect.send_auto">send_auto() (palace.ReverbEffect property)</a>
</li>
<li><a href="reference.html#palace.Source.sends">sends() (palace.Source property)</a>
<li><a href="reference/source.html#palace.Source.sends">sends() (palace.Source property)</a>
</li>
<li><a href="reference.html#palace.Buffer.size">size() (palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.size">size() (palace.Buffer property)</a>
</li>
<li><a href="reference.html#palace.BaseEffect.slot_gain">slot_gain() (palace.BaseEffect property)</a>
<li><a href="reference/effect.html#palace.BaseEffect.slot_gain">slot_gain() (palace.BaseEffect property)</a>
</li>
<li><a href="reference.html#palace.Source">Source (class in palace)</a>
<li><a href="reference/source.html#palace.Source">Source (class in palace)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Buffer.source_count">source_count() (palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.source_count">source_count() (palace.Buffer property)</a>
</li>
<li><a href="reference.html#palace.MessageHandler.source_force_stopped">source_force_stopped() (palace.MessageHandler method)</a>
<li><a href="reference/context.html#palace.MessageHandler.source_force_stopped">source_force_stopped() (palace.MessageHandler method)</a>
</li>
<li><a href="reference.html#palace.BaseEffect.source_sends">source_sends() (palace.BaseEffect property)</a>
<li><a href="reference/effect.html#palace.BaseEffect.source_sends">source_sends() (palace.BaseEffect property)</a>
</li>
<li><a href="reference.html#palace.MessageHandler.source_stopped">source_stopped() (palace.MessageHandler method)</a>
<li><a href="reference/context.html#palace.MessageHandler.source_stopped">source_stopped() (palace.MessageHandler method)</a>
</li>
<li><a href="reference.html#palace.SourceGroup">SourceGroup (class in palace)</a>
<li><a href="reference/source.html#palace.SourceGroup">SourceGroup (class in palace)</a>
</li>
<li><a href="reference.html#palace.Buffer.sources">sources() (palace.Buffer property)</a>
<li><a href="reference/buffer.html#palace.Buffer.sources">sources() (palace.Buffer property)</a>
<ul>
<li><a href="reference.html#palace.SourceGroup.sources">(palace.SourceGroup property)</a>
<li><a href="reference/source.html#palace.SourceGroup.sources">(palace.SourceGroup property)</a>
</li>
</ul></li>
<li><a href="reference.html#palace.Source.spatialize">spatialize (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.spatialize">spatialize (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.Context.speed_of_sound">speed_of_sound() (palace.Context property)</a>
<li><a href="reference/context.html#palace.Context.speed_of_sound">speed_of_sound() (palace.Context property)</a>
</li>
<li><a href="reference.html#palace.Context.start_batch">start_batch() (palace.Context method)</a>
<li><a href="reference/context.html#palace.Context.start_batch">start_batch() (palace.Context method)</a>
</li>
<li><a href="reference.html#palace.Source.stereo_angles">stereo_angles (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.stereo_angles">stereo_angles (palace.Source attribute)</a>
</li>
<li><a href="reference.html#palace.STEREO_SOURCES">STEREO_SOURCES (in module palace)</a>
<li><a href="reference/context.html#palace.STEREO_SOURCES">STEREO_SOURCES (in module palace)</a>
</li>
<li><a href="reference.html#palace.Source.stop">stop() (palace.Source method)</a>
<li><a href="reference/source.html#palace.Source.stop">stop() (palace.Source method)</a>
</li>
<li><a href="reference.html#palace.SourceGroup.stop_all">stop_all() (palace.SourceGroup method)</a>
<li><a href="reference/source.html#palace.SourceGroup.stop_all">stop_all() (palace.SourceGroup method)</a>
</li>
<li><a href="reference.html#palace.SourceGroup.sub_groups">sub_groups() (palace.SourceGroup property)</a>
<li><a href="reference/source.html#palace.SourceGroup.sub_groups">sub_groups() (palace.SourceGroup property)</a>
</li>
</ul></td>
</tr></table>
@ -634,7 +650,7 @@
<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.thread_local">thread_local() (in module palace)</a>
<li><a href="reference/context.html#palace.thread_local">thread_local() (in module palace)</a>
</li>
</ul></td>
</tr></table>
@ -642,15 +658,15 @@
<h2 id="U">U</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Context.update">update() (palace.Context method)</a>
<li><a href="reference/context.html#palace.Context.update">update() (palace.Context method)</a>
</li>
<li><a href="reference.html#palace.use_context">use_context() (in module palace)</a>
<li><a href="reference/context.html#palace.use_context">use_context() (in module palace)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.BaseEffect.use_count">use_count() (palace.BaseEffect property)</a>
<li><a href="reference/effect.html#palace.BaseEffect.use_count">use_count() (palace.BaseEffect property)</a>
</li>
<li><a href="reference.html#palace.use_fileio">use_fileio() (in module palace)</a>
<li><a href="reference/file-io.html#palace.use_fileio">use_fileio() (in module palace)</a>
</li>
</ul></td>
</tr></table>
@ -658,11 +674,11 @@
<h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Source.velocity">velocity (palace.Source attribute)</a>
<li><a href="reference/source.html#palace.Source.velocity">velocity (palace.Source attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.Listener.velocity">velocity() (palace.Listener property)</a>
<li><a href="reference/context.html#palace.Listener.velocity">velocity() (palace.Listener property)</a>
</li>
</ul></td>
</tr></table>
@ -670,7 +686,7 @@
<h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference.html#palace.ChorusEffect.waveform">waveform (palace.ChorusEffect attribute)</a>
<li><a href="reference/effect.html#palace.ChorusEffect.waveform">waveform (palace.ChorusEffect attribute)</a>
</li>
</ul></td>
</tr></table>

View File

@ -4,7 +4,7 @@
<html>
<head>
<meta charset="utf-8" />
<title>Welcome to our palace! &#8212; palace 0.2.0 documentation</title>
<title>Overview &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
@ -30,7 +30,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="copying.html">Copying</a></li>
@ -59,6 +59,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
@ -89,14 +95,21 @@
<div class="body" role="main">
<div class="section" id="welcome-to-our-palace">
<h1>Welcome to our palace!<a class="headerlink" href="#welcome-to-our-palace" title="Permalink to this headline"></a></h1>
<div class="section" id="overview">
<h1>Overview<a class="headerlink" href="#overview" title="Permalink to this headline"></a></h1>
<p>Pythonic Audio Library and Codecs Environment provides common higher-level API
for audio rendering using OpenAL. It wraps around the C++ interface <a class="reference external" href="https://github.com/kcat/alure">alure</a>
for 3D positional rendering, environmental effects and out-of-the-box
codec support, while using Cython to provide a modern interface with
type hinting, data descriptors, context managers and <code class="docutils literal notranslate"><span class="pre">snake_case</span></code>
for a safe, convenient and pleasurable experience.</p>
for audio rendering using OpenAL:</p>
<ul class="simple">
<li><p>3D positional rendering, with <a class="reference external" href="https://en.wikipedia.org/wiki/Head-related_transfer_function">HRTF</a> support for stereo systems</p></li>
<li><p>Environmental effects: reverb, atmospheric air absorption,
sound occlusion and obstruction</p></li>
<li><p>Out-of-the-box codec support:</p></li>
</ul>
<p>Palace wraps around the C++ interface <a class="reference external" href="https://github.com/kcat/alure">alure</a> using <a class="reference external" href="https://cython.org">Cython</a> for a safe and
convenient interface with type hinting, data descriptors and context managers,
following <span class="target" id="index-0"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0008#naming-conventions"><strong>PEP 8#naming-conventions</strong></a> (<code class="docutils literal notranslate"><span class="pre">PascalCase.snake_case</span></code>).</p>
<div class="section" id="table-of-contents">
<h2>Table of Contents<a class="headerlink" href="#table-of-contents" title="Permalink to this headline"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a><ul>
@ -110,14 +123,14 @@ for a safe, convenient and pleasurable experience.</p>
<li class="toctree-l2"><a class="reference internal" href="tutorial/play-audio.html">Play an Audio</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="reference.html#audio-devices">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#audio-library-contexts">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#resource-caching">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#sources-source-groups">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#environmental-effects">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#decoder-interface">Decoder Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference.html#file-i-o-interface">File I/O Interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="reference/device.html">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/context.html">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/buffer.html">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/effect.html">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/decoder.html">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="reference/file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a><ul>
@ -143,12 +156,13 @@ for a safe, convenient and pleasurable experience.</p>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h1>
<h2>Indices and Tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
</ul>
</div>
</div>

View File

@ -15,7 +15,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Tutorial" href="tutorial/index.html" />
<link rel="prev" title="Welcome to our palace!" href="index.html" />
<link rel="prev" title="Overview" href="index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
@ -36,7 +36,7 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="copying.html">Copying</a></li>
@ -65,6 +65,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
@ -86,7 +92,7 @@
<ul>
<li>
&larr;
<a href="index.html" title="Previous document">Welcome to our palace!</a>
<a href="index.html" title="Previous document">Overview</a>
</li>
<li>
<a href="tutorial/index.html" title="Next document">Tutorial</a>
@ -137,7 +143,7 @@ Palace can then be compiled and installed by running:</p>
<ul>
<li>
&larr;
<a href="index.html" title="Previous document">Welcome to our palace!</a>
<a href="index.html" title="Previous document">Overview</a>
</li>
<li>
<a href="tutorial/index.html" title="Next document">Tutorial</a>

Binary file not shown.

View File

@ -1,124 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Python Module Index &#8212; palace 0.1.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
<script>
DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
</script>
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Python Module Index</h1>
<div class="modindex-jumpbox">
<a href="#cap-p"><strong>p</strong></a>
</div>
<table class="indextable modindextable">
<tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
<tr class="cap" id="cap-p"><td></td><td>
<strong>p</strong></td><td></td></tr>
<tr>
<td></td>
<td>
<a href="reference.html#module-palace"><code class="xref">palace</code></a></td><td>
<em></em></td></tr>
</table>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">palace</a></h1>
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.0+/d21cb1f</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

349
html/reference/buffer.html Normal file
View File

@ -0,0 +1,349 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Resource Caching &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Sources &amp; Source Groups" href="source.html" />
<link rel="prev" title="Audio Library Contexts" href="context.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="device.html">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html">Audio Library Contexts</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="context.html" title="Previous document">Audio Library Contexts</a>
</li>
<li>
<a href="source.html" title="Next document">Sources &amp; Source Groups</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="resource-caching">
<h1>Resource Caching<a class="headerlink" href="#resource-caching" title="Permalink to this headline"></a></h1>
<div class="section" id="audio-buffers">
<h2>Audio Buffers<a class="headerlink" href="#audio-buffers" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.Buffer">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">Buffer</code><a class="headerlink" href="#palace.Buffer" title="Permalink to this definition"></a></dt>
<dd><p>Buffer of preloaded PCM samples coming from a <cite>Decoder</cite>.</p>
<p>Cached buffers must be freed using <cite>destroy</cite> before destroying
<cite>context</cite>. Alternatively, this can be used as a context manager
that calls <cite>destroy</cite> upon completion of the block,
even if an error occurs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>str</em>) Audio file or resource name. Multiple calls with the same name
will return the same buffer.</p></li>
<li><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the buffer is to be created and cached.
By default <cite>current_context()</cite> is used.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt id="palace.Buffer.name">
<code class="sig-name descname">name</code><a class="headerlink" href="#palace.Buffer.name" title="Permalink to this definition"></a></dt>
<dd><p>Audio file or resource name.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<dl class="py method">
<dt id="palace.Buffer.channel_config">
<em class="property">property </em><code class="sig-name descname">channel_config</code><a class="headerlink" href="#palace.Buffer.channel_config" title="Permalink to this definition"></a></dt>
<dd><p>Buffers sample configuration.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.destroy">
<code class="sig-name descname">destroy</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Buffer.destroy" title="Permalink to this definition"></a></dt>
<dd><p>Free the buffers cache.</p>
<p>This invalidates all other <cite>Buffer</cite> objects with the same name.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.frequency">
<em class="property">property </em><code class="sig-name descname">frequency</code><a class="headerlink" href="#palace.Buffer.frequency" title="Permalink to this definition"></a></dt>
<dd><p>Buffers frequency in hertz.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.from_decoder">
<em class="property">static </em><code class="sig-name descname">from_decoder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">decoder</span><span class="p">:</span> <span class="n"><a class="reference internal" href="decoder.html#palace.Decoder" title="palace.Decoder">palace.Decoder</a></span></em>, <em class="sig-param"><span class="n">name</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">context</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference internal" href="context.html#palace.Context" title="palace.Context">palace.Context</a><span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="#palace.Buffer" title="palace.Buffer">palace.Buffer</a><a class="headerlink" href="#palace.Buffer.from_decoder" title="Permalink to this definition"></a></dt>
<dd><p>Return a buffer created by reading the given decoder.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>decoder</strong> (<a class="reference internal" href="decoder.html#palace.Decoder" title="palace.Decoder"><em>Decoder</em></a>) The decoder from which the buffer is to be cached.</p></li>
<li><p><strong>name</strong> (<em>str</em>) The name to give to the buffer. It may alias an audio file,
but it must not currently exist in the buffer cache.</p></li>
<li><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the buffer is to be created.
By default <cite>current_context()</cite> is used.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If there is neither any context specified nor current;
or if <cite>name</cite> is already used for another buffer.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.length">
<em class="property">property </em><code class="sig-name descname">length</code><a class="headerlink" href="#palace.Buffer.length" title="Permalink to this definition"></a></dt>
<dd><p>Length of the buffer in sample frames.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.length_seconds">
<em class="property">property </em><code class="sig-name descname">length_seconds</code><a class="headerlink" href="#palace.Buffer.length_seconds" title="Permalink to this definition"></a></dt>
<dd><p>Length of the buffer in seconds.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Buffer.loop_points">
<code class="sig-name descname">loop_points</code><a class="headerlink" href="#palace.Buffer.loop_points" title="Permalink to this definition"></a></dt>
<dd><p>Loop points for looping sources.</p>
<p>If the <cite>AL_SOFT_loop_points</cite> extension is not supported by the
current context, <cite>start = 0</cite> and <cite>end = length</cite> respectively.
Otherwise, <cite>start &lt; end &lt;= length</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start</strong> (<em>int</em>) Starting point, in sample frames (inclusive).</p></li>
<li><p><strong>end</strong> (<em>int</em>) Ending point, in sample frames (exclusive).</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>The buffer must not be in use when this property is set.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.play">
<code class="sig-name descname">play</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference internal" href="source.html#palace.Source" title="palace.Source">palace.Source</a><span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="source.html#palace.Source" title="palace.Source">palace.Source</a><a class="headerlink" href="#palace.Buffer.play" title="Permalink to this definition"></a></dt>
<dd><p>Play <cite>source</cite> using the buffer.</p>
<p>Return the source used for playing. If <cite>None</cite> is given,
create a new one.</p>
<p>One buffer may be played from multiple sources simultaneously.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.sample_type">
<em class="property">property </em><code class="sig-name descname">sample_type</code><a class="headerlink" href="#palace.Buffer.sample_type" title="Permalink to this definition"></a></dt>
<dd><p>Buffers sample type.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.size">
<em class="property">property </em><code class="sig-name descname">size</code><a class="headerlink" href="#palace.Buffer.size" title="Permalink to this definition"></a></dt>
<dd><p>Storage size used by the buffer, in bytes.</p>
<p class="rubric">Notes</p>
<p>The size in bytes may not be what you expect from the length,
as it may take more space internally than the <cite>channel_config</cite>
and <cite>sample_type</cite> suggest.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.source_count">
<em class="property">property </em><code class="sig-name descname">source_count</code><a class="headerlink" href="#palace.Buffer.source_count" title="Permalink to this definition"></a></dt>
<dd><p>Number of sources currently using the buffer.</p>
<p class="rubric">Notes</p>
<p><cite>Context.update</cite> needs to be called to reliably ensure the count
is kept updated for when sources reach their end. This is
equivalent to calling <cite>len(self.sources)</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Buffer.sources">
<em class="property">property </em><code class="sig-name descname">sources</code><a class="headerlink" href="#palace.Buffer.sources" title="Permalink to this definition"></a></dt>
<dd><p><cite>Source</cite> objects currently playing the buffer.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="loading-freeing-in-batch">
<h2>Loading &amp; Freeing in Batch<a class="headerlink" href="#loading-freeing-in-batch" title="Permalink to this headline"></a></h2>
<dl class="py function">
<dt id="palace.cache">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">cache</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">names</span><span class="p">:</span> <span class="n">Iterable<span class="p">[</span>str<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">context</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference internal" href="context.html#palace.Context" title="palace.Context">palace.Context</a><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.cache" title="Permalink to this definition"></a></dt>
<dd><p>Cache given audio resources asynchronously.</p>
<p>Duplicate names and buffers already cached are ignored.
Cached buffers must be freed before destroying the context.</p>
<p>The resources will be scheduled for caching asynchronously,
and should be retrieved later when needed by initializing
<cite>Buffer</cite> corresponding objects. Resources that cannot be
loaded, for example due to an unsupported format, will be
ignored and a later <cite>Buffer</cite> initialization will raise
an exception.</p>
<p>If <cite>context</cite> is not given, <cite>current_context()</cite> will be used.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.free" title="palace.free"><code class="xref py py-func docutils literal notranslate"><span class="pre">free()</span></code></a></dt><dd><p>Free cached audio resources given their names</p>
</dd>
<dt><a class="reference internal" href="#palace.Buffer.destroy" title="palace.Buffer.destroy"><code class="xref py py-func docutils literal notranslate"><span class="pre">Buffer.destroy()</span></code></a></dt><dd><p>Free the buffers cache</p>
</dd>
</dl>
</div>
</dd></dl>
<dl class="py function">
<dt id="palace.free">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">free</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">names</span><span class="p">:</span> <span class="n">Iterable<span class="p">[</span>str<span class="p">]</span></span></em>, <em class="sig-param"><span class="n">context</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference internal" href="context.html#palace.Context" title="palace.Context">palace.Context</a><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.free" title="Permalink to this definition"></a></dt>
<dd><p>Free cached audio resources given their names.</p>
<p>If <cite>context</cite> is not given, <cite>current_context()</cite> will be used.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="context.html" title="Previous document">Audio Library Contexts</a>
</li>
<li>
<a href="source.html" title="Next document">Sources &amp; Source Groups</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/buffer.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

580
html/reference/context.html Normal file
View File

@ -0,0 +1,580 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Audio Library Contexts &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Resource Caching" href="buffer.html" />
<link rel="prev" title="Audio Devices" href="device.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="device.html">Audio Devices</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="device.html" title="Previous document">Audio Devices</a>
</li>
<li>
<a href="buffer.html" title="Next document">Resource Caching</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="audio-library-contexts">
<h1>Audio Library Contexts<a class="headerlink" href="#audio-library-contexts" title="Permalink to this headline"></a></h1>
<div class="section" id="context-and-auxiliary-classes">
<h2>Context and Auxiliary Classes<a class="headerlink" href="#context-and-auxiliary-classes" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.Context">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">Context</code><a class="headerlink" href="#palace.Context" title="Permalink to this definition"></a></dt>
<dd><p>Container maintaining the audio environment.</p>
<p>Context contains the environments settings and components
such as sources, buffers and effects.</p>
<p>This can be used as a context manager, e.g.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">with</span> <span class="n">context</span><span class="p">:</span>
<span class="o">...</span>
</pre></div>
</div>
<p>is equivalent to</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">previous</span> <span class="o">=</span> <span class="n">current_context</span><span class="p">()</span>
<span class="n">use_context</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="o">...</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">use_context</span><span class="p">(</span><span class="n">previous</span><span class="p">)</span>
<span class="n">context</span><span class="o">.</span><span class="n">destroy</span><span class="p">()</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>device</strong> (<a class="reference internal" href="device.html#palace.Device" title="palace.Device"><em>Device</em></a>) The <cite>device</cite> on which the context is to be created.</p></li>
<li><p><strong>attrs</strong> (<em>Dict</em><em>[</em><em>int</em><em>, </em><em>int</em><em>]</em>) Attributes specified for the context to be created.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt id="palace.Context.device">
<code class="sig-name descname">device</code><a class="headerlink" href="#palace.Context.device" title="Permalink to this definition"></a></dt>
<dd><p>The device this context was created from.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference internal" href="device.html#palace.Device" title="palace.Device">Device</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Context.listener">
<code class="sig-name descname">listener</code><a class="headerlink" href="#palace.Context.listener" title="Permalink to this definition"></a></dt>
<dd><p>The listener instance of this context.</p>
<dl class="field-list simple">
<dt class="field-odd">Type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#palace.Listener" title="palace.Listener">Listener</a></p>
</dd>
</dl>
</dd></dl>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>RuntimeError</strong> If context creation fails.</p>
</dd>
</dl>
<dl class="py attribute">
<dt id="palace.Context.async_wake_interval">
<code class="sig-name descname">async_wake_interval</code><a class="headerlink" href="#palace.Context.async_wake_interval" title="Permalink to this definition"></a></dt>
<dd><p>Current interval used for waking up the background thread.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.available_resamplers">
<em class="property">property </em><code class="sig-name descname">available_resamplers</code><a class="headerlink" href="#palace.Context.available_resamplers" title="Permalink to this definition"></a></dt>
<dd><p>The list of resamplers supported by the context.</p>
<p>If the <cite>AL_SOFT_source_resampler</cite> extension is unsupported
this will be an empty list, otherwise there would be
at least one entry.</p>
<p>This method require the context to be current.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.default_resampler_index">
<em class="property">property </em><code class="sig-name descname">default_resampler_index</code><a class="headerlink" href="#palace.Context.default_resampler_index" title="Permalink to this definition"></a></dt>
<dd><p>The contexts default resampler index.</p>
<p>If the <cite>AL_SOFT_source_resampler</cite> extension is unsupported
the resampler list will be empty and this will return 0.</p>
<p>If you try to access the resampler list with this index
without extension, undefined behavior will occur
(accessing an out of bounds array index).</p>
<p>This method require the context to be current.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.destroy">
<code class="sig-name descname">destroy</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Context.destroy" title="Permalink to this definition"></a></dt>
<dd><p>Destroy the context.</p>
<p>The context must not be current when this is called.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.distance_model">
<em class="property">property </em><code class="sig-name descname">distance_model</code><a class="headerlink" href="#palace.Context.distance_model" title="Permalink to this definition"></a></dt>
<dd><p>The model for source attenuation based on distance.</p>
<p>The default, inverse clamped, provides a realistic l/r
reduction in volume (that is, every doubling of distance
cause the gain to reduce by half).</p>
<p>The clamped distance models restrict the source distance for
the purpose of distance attenuation, so a source wont sound
closer than its reference distance or farther than its max
distance.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> If set to a preset cannot be found in <cite>distance_models</cite>.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.doppler_factor">
<em class="property">property </em><code class="sig-name descname">doppler_factor</code><a class="headerlink" href="#palace.Context.doppler_factor" title="Permalink to this definition"></a></dt>
<dd><p>Factor to apply to all sources doppler calculations.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.end_batch">
<code class="sig-name descname">end_batch</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Context.end_batch" title="Permalink to this definition"></a></dt>
<dd><p>Continue processing the context and end batching.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.is_supported">
<code class="sig-name descname">is_supported</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">channel_config</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">sample_type</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#palace.Context.is_supported" title="Permalink to this definition"></a></dt>
<dd><p>Return if the channel config and sample type is supported.</p>
<p>This method require the context to be current.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="decoder.html#palace.sample_types" title="palace.sample_types"><code class="xref py py-meth docutils literal notranslate"><span class="pre">sample_types()</span></code></a></dt><dd><p>Set of sample types</p>
</dd>
<dt><a class="reference internal" href="decoder.html#palace.channel_configs" title="palace.channel_configs"><code class="xref py py-meth docutils literal notranslate"><span class="pre">channel_configs()</span></code></a></dt><dd><p>Set of channel configurations</p>
</dd>
</dl>
</div>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Context.message_handler">
<code class="sig-name descname">message_handler</code><a class="headerlink" href="#palace.Context.message_handler" title="Permalink to this definition"></a></dt>
<dd><p>Handler of some certain events.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.speed_of_sound">
<em class="property">property </em><code class="sig-name descname">speed_of_sound</code><a class="headerlink" href="#palace.Context.speed_of_sound" title="Permalink to this definition"></a></dt>
<dd><p>The speed of sound propagation in units per second.</p>
<p>It is used to calculate the doppler effect along with other
distance-related time effects.</p>
<p>The default is 343.3 units per second (a realistic speed
assuming 1 meter per unit). If this is adjusted for a
different unit scale, <cite>Listener.meters_per_unit</cite> should
also be adjusted.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.start_batch">
<code class="sig-name descname">start_batch</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Context.start_batch" title="Permalink to this definition"></a></dt>
<dd><p>Suspend the context to start batching.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Context.update">
<code class="sig-name descname">update</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Context.update" title="Permalink to this definition"></a></dt>
<dd><p>Update the context and all sources belonging to this context.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="palace.Listener">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">Listener</code><a class="headerlink" href="#palace.Listener" title="Permalink to this definition"></a></dt>
<dd><p>Listener instance of the given context.</p>
<p>It is recommended that applications access the listener via
<cite>Context.listener</cite>, which avoid the overhead caused by the
creation of the wrapper object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context on which the listener instance is to be created.
By default <cite>current_context()</cite> is used.</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<dl class="py method">
<dt id="palace.Listener.gain">
<em class="property">property </em><code class="sig-name descname">gain</code><a class="headerlink" href="#palace.Listener.gain" title="Permalink to this definition"></a></dt>
<dd><p>Master gain for all context output.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Listener.meters_per_unit">
<em class="property">property </em><code class="sig-name descname">meters_per_unit</code><a class="headerlink" href="#palace.Listener.meters_per_unit" title="Permalink to this definition"></a></dt>
<dd><p>Number of meters per unit.</p>
<p>This is used for various effects relying on the distance
in meters including air absorption and initial reverb decay.
If this is changed, so should the speed of sound
(e.g. <cite>context.speed_of_sound = 343.3 / meters_per_unit</cite>
to maintain a realistic 343.3 m/s for sound propagation).</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Listener.orientation">
<em class="property">property </em><code class="sig-name descname">orientation</code><a class="headerlink" href="#palace.Listener.orientation" title="Permalink to this definition"></a></dt>
<dd><p>3D orientation of the listener.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>at</strong> (<em>Tuple</em><em>[</em><em>float</em><em>, </em><em>float</em><em>, </em><em>float</em><em>]</em>) Relative position.</p></li>
<li><p><strong>up</strong> (<em>Tuple</em><em>[</em><em>float</em><em>, </em><em>float</em><em>, </em><em>float</em><em>]</em>) Relative direction.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.Listener.position">
<em class="property">property </em><code class="sig-name descname">position</code><a class="headerlink" href="#palace.Listener.position" title="Permalink to this definition"></a></dt>
<dd><p>3D position of the listener.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Listener.velocity">
<em class="property">property </em><code class="sig-name descname">velocity</code><a class="headerlink" href="#palace.Listener.velocity" title="Permalink to this definition"></a></dt>
<dd><p>3D velocity of the listener, in units per second.</p>
<p>As with OpenAL, this does not actually alter the listeners
position, and instead just alters the pitch as determined by
the doppler effect.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="palace.MessageHandler">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">MessageHandler</code><a class="headerlink" href="#palace.MessageHandler" title="Permalink to this definition"></a></dt>
<dd><p>Message handler interface.</p>
<p>Applications may derive from this and set an instance on a context
to receive messages. The base methods are no-ops, so subclasses
only need to implement methods for relevant messages.</p>
<p>Exceptions raised from <cite>MessageHandler</cite> instances are ignored.</p>
<dl class="py method">
<dt id="palace.MessageHandler.buffer_loading">
<code class="sig-name descname">buffer_loading</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">channel_config</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">sample_type</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">sample_rate</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">Sequence<span class="p">[</span>int<span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.MessageHandler.buffer_loading" title="Permalink to this definition"></a></dt>
<dd><p>Handle messages from Buffer initialization.</p>
<p>This is called when a new buffer is about to be created
and loaded. which may be called asynchronously for buffers
being loaded asynchronously.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>str</em>) Resource name passed to <cite>Buffer</cite>.</p></li>
<li><p><strong>channel_config</strong> (<em>str</em>) Channel configuration of the given audio data.</p></li>
<li><p><strong>sample_type</strong> (<em>str</em>) Sample type of the given audio data.</p></li>
<li><p><strong>sample_rate</strong> (<em>int</em>) Sample rate of the given audio data.</p></li>
<li><p><strong>data</strong> (<em>MutableSequence</em><em>[</em><em>int</em><em>]</em>) <p>The audio data that is about to be fed to the OpenAL buffer.</p>
<p>It is a mutable memory array of signed 8-bit integers,
following Python buffer protocol.</p>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.MessageHandler.device_disconnected">
<code class="sig-name descname">device_disconnected</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">device</span><span class="p">:</span> <span class="n"><a class="reference internal" href="device.html#palace.Device" title="palace.Device">palace.Device</a></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.MessageHandler.device_disconnected" title="Permalink to this definition"></a></dt>
<dd><p>Handle disconnected device messages.</p>
<p>This is called when the given device has been disconnected and
is no longer usable for output. As per the <cite>ALC_EXT_disconnect</cite>
specification, disconnected devices remain valid, however all
playing sources are automatically stopped, any sources that are
attempted to play will immediately stop, and new contexts may
not be created on the device.</p>
<p class="rubric">Notes</p>
<p>Connection status is checked during <cite>Context.update</cite> calls, so
method must be called regularly to be notified when a device is
disconnected. This method may not be called if the device lacks
support for the <cite>ALC_EXT_disconnect</cite> extension.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.MessageHandler.resource_not_found">
<code class="sig-name descname">resource_not_found</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; str<a class="headerlink" href="#palace.MessageHandler.resource_not_found" title="Permalink to this definition"></a></dt>
<dd><p>Return the fallback resource for the one of the given name.</p>
<p>This is called when <cite>name</cite> is not found, allowing substitution
of a different resource until the returned string either points
to a valid resource or is empty (default).</p>
<p>For buffers being cached, the original name will still be used
for the cache entry so one does not have to keep track of
substituted resource names.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.MessageHandler.source_force_stopped">
<code class="sig-name descname">source_force_stopped</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source</span><span class="p">:</span> <span class="n"><a class="reference internal" href="source.html#palace.Source" title="palace.Source">palace.Source</a></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.MessageHandler.source_force_stopped" title="Permalink to this definition"></a></dt>
<dd><p>Handle forcefully stopped sources.</p>
<p>This is called when the given source was forced to stop,
because of one of the following reasons:</p>
<ul class="simple">
<li><p>There were no more mixing sources and a higher-priority source
preempted it.</p></li>
<li><p><cite>source</cite> is part of a <cite>SourceGroup</cite> (or sub-group thereof)
that had its <cite>SourceGroup.stop_all</cite> method called.</p></li>
<li><p><cite>source</cite> was playing a buffer thats getting removed.</p></li>
</ul>
</dd></dl>
<dl class="py method">
<dt id="palace.MessageHandler.source_stopped">
<code class="sig-name descname">source_stopped</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source</span><span class="p">:</span> <span class="n"><a class="reference internal" href="source.html#palace.Source" title="palace.Source">palace.Source</a></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.MessageHandler.source_stopped" title="Permalink to this definition"></a></dt>
<dd><p>Handle end-of-buffer/stream messages.</p>
<p>This is called when the given source reaches the end of buffer
or stream, which is detected upon a call to <cite>Context.update</cite>.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="using-contexts">
<h2>Using Contexts<a class="headerlink" href="#using-contexts" title="Permalink to this headline"></a></h2>
<dl class="py function">
<dt id="palace.use_context">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">use_context</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">context</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference internal" href="#palace.Context" title="palace.Context">palace.Context</a><span class="p">]</span></span></em>, <em class="sig-param"><span class="n">thread</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>bool<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.use_context" title="Permalink to this definition"></a></dt>
<dd><p>Make the specified context current for OpenAL operations.</p>
<p>This fails silently if the given context has been destroyed.
In case <cite>thread</cite> is not specified, fallback to preference made by
<cite>thread_local</cite>.</p>
<p>If <cite>thread</cite> is <cite>True</cite>, make the context current
for OpenAL operations on the calling thread only.
This requires the non-device-specific as well as the contexts
device <cite>ALC_EXT_thread_local_context</cite> extension to be available.</p>
</dd></dl>
<dl class="py function">
<dt id="palace.current_context">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">current_context</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">thread</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>bool<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; Optional<span class="p">[</span><a class="reference internal" href="#palace.Context" title="palace.Context">palace.Context</a><span class="p">]</span><a class="headerlink" href="#palace.current_context" title="Permalink to this definition"></a></dt>
<dd><p>Return the context that is currently used.</p>
<p>If <cite>thread</cite> is set to <cite>True</cite>, return the thread-specific context
used for OpenAL operations. This requires the non-device-specific
as well as the contexts device <cite>ALC_EXT_thread_local_context</cite>
extension to be available.</p>
<p>In case <cite>thread</cite> is not specified, fallback to preference made by
<cite>thread_local</cite>.</p>
</dd></dl>
<dl class="py function">
<dt id="palace.thread_local">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">thread_local</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">state</span><span class="p">:</span> <span class="n">bool</span></em><span class="sig-paren">)</span> &#x2192; Iterator[None]<a class="headerlink" href="#palace.thread_local" title="Permalink to this definition"></a></dt>
<dd><p>Return a context manager controlling preference of local thread.</p>
<p>Effectively, it sets the fallback value for the <cite>thread</cite> argument
for <cite>current_context</cite> and <cite>use_context</cite>.</p>
<p>Initially, globally current <cite>Context</cite> is preferred.</p>
</dd></dl>
</div>
<div class="section" id="context-creation-attributes">
<h2>Context Creation Attributes<a class="headerlink" href="#context-creation-attributes" title="Permalink to this headline"></a></h2>
<dl class="py data">
<dt id="palace.CHANNEL_CONFIG">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">CHANNEL_CONFIG</code><em class="property">: int</em><a class="headerlink" href="#palace.CHANNEL_CONFIG" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify the channel configuration
(either <code class="docutils literal notranslate"><span class="pre">MONO</span></code>, <code class="docutils literal notranslate"><span class="pre">STEREO</span></code>, <code class="docutils literal notranslate"><span class="pre">QUAD</span></code>, <code class="docutils literal notranslate"><span class="pre">X51</span></code>, <code class="docutils literal notranslate"><span class="pre">X61</span></code> or <code class="docutils literal notranslate"><span class="pre">X71</span></code>).</p>
</dd></dl>
<dl class="py data">
<dt id="palace.SAMPLE_TYPE">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">SAMPLE_TYPE</code><em class="property">: int</em><a class="headerlink" href="#palace.SAMPLE_TYPE" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify the sample type
(either <code class="docutils literal notranslate"><span class="pre">[UNSIGNED_]{BYTE,SHORT,INT}</span></code> or <code class="docutils literal notranslate"><span class="pre">FLOAT</span></code>).</p>
</dd></dl>
<dl class="py data">
<dt id="palace.FREQUENCY">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">FREQUENCY</code><em class="property">: int</em><a class="headerlink" href="#palace.FREQUENCY" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify the frequency in hertz.</p>
</dd></dl>
<dl class="py data">
<dt id="palace.MONO_SOURCES">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">MONO_SOURCES</code><em class="property">: int</em><a class="headerlink" href="#palace.MONO_SOURCES" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify the number of mono (3D) sources.</p>
</dd></dl>
<dl class="py data">
<dt id="palace.STEREO_SOURCES">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">STEREO_SOURCES</code><em class="property">: int</em><a class="headerlink" href="#palace.STEREO_SOURCES" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify the number of stereo sources.</p>
</dd></dl>
<dl class="py data">
<dt id="palace.MAX_AUXILIARY_SENDS">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">MAX_AUXILIARY_SENDS</code><em class="property">: int</em><a class="headerlink" href="#palace.MAX_AUXILIARY_SENDS" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify the maximum number of
auxiliary source sends.</p>
</dd></dl>
<dl class="py data">
<dt id="palace.HRTF">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">HRTF</code><em class="property">: int</em><a class="headerlink" href="#palace.HRTF" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify whether to enable HRTF
(either <code class="docutils literal notranslate"><span class="pre">FALSE</span></code>, <code class="docutils literal notranslate"><span class="pre">TRUE</span></code> or <code class="docutils literal notranslate"><span class="pre">DONT_CARE</span></code>).</p>
</dd></dl>
<dl class="py data">
<dt id="palace.HRTF_ID">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">HRTF_ID</code><em class="property">: int</em><a class="headerlink" href="#palace.HRTF_ID" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify the HRTF to be used.</p>
</dd></dl>
<dl class="py data">
<dt id="palace.OUTPUT_LIMITER">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">OUTPUT_LIMITER</code><em class="property">: int</em><a class="headerlink" href="#palace.OUTPUT_LIMITER" title="Permalink to this definition"></a></dt>
<dd><p>Context creation key to specify whether to use a gain limiter
(either <code class="docutils literal notranslate"><span class="pre">FALSE</span></code>, <code class="docutils literal notranslate"><span class="pre">TRUE</span></code> or <code class="docutils literal notranslate"><span class="pre">DONT_CARE</span></code>).</p>
</dd></dl>
<dl class="py data">
<dt id="palace.distance_models">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">distance_models</code><em class="property">: Tuple[str, ...]</em><a class="headerlink" href="#palace.distance_models" title="Permalink to this definition"></a></dt>
<dd><p>Names of available distance models.</p>
</dd></dl>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="device.html" title="Previous document">Audio Devices</a>
</li>
<li>
<a href="buffer.html" title="Next document">Resource Caching</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/context.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

428
html/reference/decoder.html Normal file
View File

@ -0,0 +1,428 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Audio Streams &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="File I/O Interface" href="file-io.html" />
<link rel="prev" title="Environmental Effects" href="effect.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="device.html">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html">Environmental Effects</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="effect.html" title="Previous document">Environmental Effects</a>
</li>
<li>
<a href="file-io.html" title="Next document">File I/O Interface</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="audio-streams">
<h1>Audio Streams<a class="headerlink" href="#audio-streams" title="Permalink to this headline"></a></h1>
<div class="section" id="builtin-decoders">
<h2>Builtin Decoders<a class="headerlink" href="#builtin-decoders" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.Decoder">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">Decoder</code><a class="headerlink" href="#palace.Decoder" title="Permalink to this definition"></a></dt>
<dd><p>Generic audio decoder.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>str</em>) Audio file or resource name.</p></li>
<li><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the decoder is to be created.
By default <cite>current_context()</cite> is used.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="buffer.html#palace.Buffer" title="palace.Buffer"><code class="xref py py-class docutils literal notranslate"><span class="pre">Buffer</span></code></a></dt><dd><p>Preloaded PCM samples coming from a <cite>Decoder</cite></p>
</dd>
</dl>
</div>
<p class="rubric">Notes</p>
<p>Due to implementation details, while this creates decoder objects
from filenames using contexts, it is the superclass of the ABC
(abstract base class) <cite>BaseDecoder</cite>. Because of this, <cite>Decoder</cite>
may only initialize an internal one. To use registered factories,
please call the module-level <cite>decode</cite> function instead.</p>
<dl class="py method">
<dt id="palace.Decoder.channel_config">
<em class="property">property </em><code class="sig-name descname">channel_config</code><a class="headerlink" href="#palace.Decoder.channel_config" title="Permalink to this definition"></a></dt>
<dd><p>Channel configuration of the audio being decoded.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.frequency">
<em class="property">property </em><code class="sig-name descname">frequency</code><a class="headerlink" href="#palace.Decoder.frequency" title="Permalink to this definition"></a></dt>
<dd><p>Sample frequency, in hertz, of the audio being decoded.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.length">
<em class="property">property </em><code class="sig-name descname">length</code><a class="headerlink" href="#palace.Decoder.length" title="Permalink to this definition"></a></dt>
<dd><p>Length of audio in sample frames, falling-back to 0.</p>
<p class="rubric">Notes</p>
<p>Zero-length decoders may not be used to load a <cite>Buffer</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.length_seconds">
<em class="property">property </em><code class="sig-name descname">length_seconds</code><a class="headerlink" href="#palace.Decoder.length_seconds" title="Permalink to this definition"></a></dt>
<dd><p>Length of audio in seconds, falling-back to 0.0.</p>
<p class="rubric">Notes</p>
<p>Zero-length decoders may not be used to load a <cite>Buffer</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.loop_points">
<em class="property">property </em><code class="sig-name descname">loop_points</code><a class="headerlink" href="#palace.Decoder.loop_points" title="Permalink to this definition"></a></dt>
<dd><p>Loop points in sample frames.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start</strong> (<em>int</em>) Inclusive starting loop point.</p></li>
<li><p><strong>end</strong> (<em>int</em>) Exclusive starting loop point.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>If <cite>start &gt;= end</cite>, all available samples are included
in the loop.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.play">
<code class="sig-name descname">play</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">chunk_len</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">queue_size</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">source</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference internal" href="source.html#palace.Source" title="palace.Source">palace.Source</a><span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="source.html#palace.Source" title="palace.Source">palace.Source</a><a class="headerlink" href="#palace.Decoder.play" title="Permalink to this definition"></a></dt>
<dd><p>Stream audio asynchronously from the decoder.</p>
<p>The decoder must NOT have its <cite>read</cite> or <cite>seek</cite> called
from elsewhere while in use.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>chunk_len</strong> (<em>int</em>) The number of sample frames to read for each chunk update.
Smaller values will require more frequent updates and
larger values will handle more data with each chunk.</p></li>
<li><p><strong>queue_size</strong> (<em>int</em>) The number of chunks to keep queued during playback.
Smaller values use less memory while larger values
improve protection against underruns.</p></li>
<li><p><strong>source</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="source.html#palace.Source" title="palace.Source"><em>Source</em></a><em>]</em><em>, </em><em>optional</em>) The source object to play audio. If <cite>None</cite> is given,
a new one will be created from the current context.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>The source used for playing.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.read">
<code class="sig-name descname">read</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">count</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; bytes<a class="headerlink" href="#palace.Decoder.read" title="Permalink to this definition"></a></dt>
<dd><p>Decode and return <cite>count</cite> sample frames.</p>
<p>If less than the requested count samples is returned,
the end of the audio has been reached.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.sample_length" title="palace.sample_length"><code class="xref py py-meth docutils literal notranslate"><span class="pre">sample_length()</span></code></a></dt><dd><p>length of samples of given size</p>
</dd>
</dl>
</div>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.sample_type">
<em class="property">property </em><code class="sig-name descname">sample_type</code><a class="headerlink" href="#palace.Decoder.sample_type" title="Permalink to this definition"></a></dt>
<dd><p>Sample type of the audio being decoded.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Decoder.seek">
<code class="sig-name descname">seek</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pos</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#palace.Decoder.seek" title="Permalink to this definition"></a></dt>
<dd><p>Seek to pos, specified in sample frames.</p>
<p>Return if the seek was successful.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="decoder-interface">
<h2>Decoder Interface<a class="headerlink" href="#decoder-interface" title="Permalink to this headline"></a></h2>
<dl class="py data">
<dt id="palace.decoder_factories">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">decoder_factories</code><em class="property">: DecoderNamespace</em><a class="headerlink" href="#palace.decoder_factories" title="Permalink to this definition"></a></dt>
<dd><p>Simple object for storing decoder factories.</p>
<p>User-registered factories are tried one after another
if <code class="xref py py-exc docutils literal notranslate"><span class="pre">RuntimeError</span></code> is raised, in lexicographical order.
Internal decoder factories are always used after registered ones.</p>
</dd></dl>
<dl class="py function">
<dt id="palace.decode">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">decode</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">context</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span><a class="reference internal" href="context.html#palace.Context" title="palace.Context">palace.Context</a><span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em><span class="sig-paren">)</span> &#x2192; <a class="reference internal" href="#palace.Decoder" title="palace.Decoder">palace.Decoder</a><a class="headerlink" href="#palace.decode" title="Permalink to this definition"></a></dt>
<dd><p>Return the decoder created from the given resource name.</p>
<p>This first tries user-registered decoder factories in
lexicographical order, then fallback to the internal ones.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.decoder_factories" title="palace.decoder_factories"><code class="xref py py-func docutils literal notranslate"><span class="pre">decoder_factories()</span></code></a></dt><dd><p>Simple object for storing decoder factories</p>
</dd>
</dl>
</div>
</dd></dl>
<dl class="py class">
<dt id="palace.BaseDecoder">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">BaseDecoder</code><a class="headerlink" href="#palace.BaseDecoder" title="Permalink to this definition"></a></dt>
<dd><p>Audio decoder interface.</p>
<p>Applications may derive from this, implement necessary methods,
and use it in places the API wants a <cite>BaseDecoder</cite> object.</p>
<p>Exceptions raised from <cite>BaseDecoder</cite> instances are ignored.</p>
<dl class="py method">
<dt id="palace.BaseDecoder.channel_config">
<em class="property">abstract property </em><code class="sig-name descname">channel_config</code><a class="headerlink" href="#palace.BaseDecoder.channel_config" title="Permalink to this definition"></a></dt>
<dd><p>Channel configuration of the audio being decoded.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseDecoder.frequency">
<em class="property">abstract property </em><code class="sig-name descname">frequency</code><a class="headerlink" href="#palace.BaseDecoder.frequency" title="Permalink to this definition"></a></dt>
<dd><p>Sample frequency, in hertz, of the audio being decoded.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseDecoder.length">
<em class="property">abstract property </em><code class="sig-name descname">length</code><a class="headerlink" href="#palace.BaseDecoder.length" title="Permalink to this definition"></a></dt>
<dd><p>Length of audio in sample frames, falling-back to 0.</p>
<p class="rubric">Notes</p>
<p>Zero-length decoders may not be used to load a <cite>Buffer</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseDecoder.loop_points">
<em class="property">abstract property </em><code class="sig-name descname">loop_points</code><a class="headerlink" href="#palace.BaseDecoder.loop_points" title="Permalink to this definition"></a></dt>
<dd><p>Loop points in sample frames.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start</strong> (<em>int</em>) Inclusive starting loop point.</p></li>
<li><p><strong>end</strong> (<em>int</em>) Exclusive starting loop point.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>If <cite>start &gt;= end</cite>, all available samples are included
in the loop.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseDecoder.read">
<em class="property">abstract </em><code class="sig-name descname">read</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">count</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; bytes<a class="headerlink" href="#palace.BaseDecoder.read" title="Permalink to this definition"></a></dt>
<dd><p>Decode and return <cite>count</cite> sample frames.</p>
<p>If less than the requested count samples is returned,
the end of the audio has been reached.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseDecoder.sample_type">
<em class="property">abstract property </em><code class="sig-name descname">sample_type</code><a class="headerlink" href="#palace.BaseDecoder.sample_type" title="Permalink to this definition"></a></dt>
<dd><p>Sample type of the audio being decoded.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseDecoder.seek">
<em class="property">abstract </em><code class="sig-name descname">seek</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pos</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#palace.BaseDecoder.seek" title="Permalink to this definition"></a></dt>
<dd><p>Seek to pos, specified in sample frames.</p>
<p>Return if the seek was successful.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="miscellaneous">
<h2>Miscellaneous<a class="headerlink" href="#miscellaneous" title="Permalink to this headline"></a></h2>
<dl class="py data">
<dt id="palace.sample_types">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">sample_types</code><em class="property">: Tuple[str, ...]</em><a class="headerlink" href="#palace.sample_types" title="Permalink to this definition"></a></dt>
<dd><p>Names of available sample types.</p>
</dd></dl>
<dl class="py data">
<dt id="palace.channel_configs">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">channel_configs</code><em class="property">: Tuple[str, ...]</em><a class="headerlink" href="#palace.channel_configs" title="Permalink to this definition"></a></dt>
<dd><p>Names of available channel configurations.</p>
</dd></dl>
<dl class="py function">
<dt id="palace.sample_size">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">sample_size</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">length</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">channel_config</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">sample_type</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#palace.sample_size" title="Permalink to this definition"></a></dt>
<dd><p>Return the size of the given number of sample frames.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ValueError</strong> If either channel_config or sample_type is invalid.</p></li>
<li><p><strong>RuntimeError</strong> If the byte size result too large.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="palace.sample_length">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">sample_length</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">size</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">channel_config</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">sample_type</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#palace.sample_length" title="Permalink to this definition"></a></dt>
<dd><p>Return the number of frames stored in the given byte size.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> If either channel_config or sample_type is invalid.</p>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="effect.html" title="Previous document">Environmental Effects</a>
</li>
<li>
<a href="file-io.html" title="Next document">File I/O Interface</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/decoder.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

330
html/reference/device.html Normal file
View File

@ -0,0 +1,330 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Audio Devices &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Audio Library Contexts" href="context.html" />
<link rel="prev" title="Reference" href="index.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="index.html" title="Previous document">Reference</a>
</li>
<li>
<a href="context.html" title="Next document">Audio Library Contexts</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="audio-devices">
<h1>Audio Devices<a class="headerlink" href="#audio-devices" title="Permalink to this headline"></a></h1>
<div class="section" id="device-dependent-utilities">
<h2>Device-Dependent Utilities<a class="headerlink" href="#device-dependent-utilities" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.Device">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">Device</code><a class="headerlink" href="#palace.Device" title="Permalink to this definition"></a></dt>
<dd><p>Audio mix output, via either a system stream or a hardware port.</p>
<p>This can be used as a context manager that calls <cite>close</cite> upon
completion of the block, even if an error occurs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<em>str</em><em>, </em><em>optional</em>) The name of the playback device.</p></li>
<li><p><strong>fallback</strong> (<em>Iterable</em><em>[</em><em>str</em><em>]</em><em>, </em><em>optional</em>) Device names to fallback to, default to an empty tuple.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If device creation fails.</p>
</dd>
<dt class="field-odd">Warns</dt>
<dd class="field-odd"><p><strong>RuntimeWarning</strong> Before each fallback.</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.device_names" title="palace.device_names"><code class="xref py py-class docutils literal notranslate"><span class="pre">device_names</span></code></a></dt><dd><p>Available device names</p>
</dd>
</dl>
</div>
<dl class="py method">
<dt id="palace.Device.alc_version">
<em class="property">property </em><code class="sig-name descname">alc_version</code><a class="headerlink" href="#palace.Device.alc_version" title="Permalink to this definition"></a></dt>
<dd><p>ALC version supported by this device.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.basic_name">
<em class="property">property </em><code class="sig-name descname">basic_name</code><a class="headerlink" href="#palace.Device.basic_name" title="Permalink to this definition"></a></dt>
<dd><p>Basic name of the device.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.clock_time">
<em class="property">property </em><code class="sig-name descname">clock_time</code><a class="headerlink" href="#palace.Device.clock_time" title="Permalink to this definition"></a></dt>
<dd><p>Current clock time for the device.</p>
<p class="rubric">Notes</p>
<p>This starts relative to the device being opened, and does not
increment while there are no contexts nor while processing
is paused. Currently, this may not exactly match the rate
that sources play at. In the future it may utilize an OpenAL
extension to retrieve the audio devices real clock.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.close">
<code class="sig-name descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Device.close" title="Permalink to this definition"></a></dt>
<dd><p>Close and free the device.</p>
<p>All previously-created contexts must first be destroyed.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.current_hrtf">
<em class="property">property </em><code class="sig-name descname">current_hrtf</code><a class="headerlink" href="#palace.Device.current_hrtf" title="Permalink to this definition"></a></dt>
<dd><p>Name of the HRTF currently being used by this device.</p>
<p>If HRTF is not currently enabled, this will be <cite>None</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.efx_version">
<em class="property">property </em><code class="sig-name descname">efx_version</code><a class="headerlink" href="#palace.Device.efx_version" title="Permalink to this definition"></a></dt>
<dd><p>EFX version supported by this device.</p>
<p>If the <cite>ALC_EXT_EFX</cite> extension is unsupported,
this will be <cite>(0, 0)</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.frequency">
<em class="property">property </em><code class="sig-name descname">frequency</code><a class="headerlink" href="#palace.Device.frequency" title="Permalink to this definition"></a></dt>
<dd><p>Playback frequency in hertz.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.hrtf_enabled">
<em class="property">property </em><code class="sig-name descname">hrtf_enabled</code><a class="headerlink" href="#palace.Device.hrtf_enabled" title="Permalink to this definition"></a></dt>
<dd><p>Whether HRTF is enabled on the device.</p>
<p>If the <cite>ALC_SOFT_HRTF</cite> extension is unavailable,
this will return False although there could still be
HRTF applied at a lower hardware level.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.hrtf_names">
<em class="property">property </em><code class="sig-name descname">hrtf_names</code><a class="headerlink" href="#palace.Device.hrtf_names" title="Permalink to this definition"></a></dt>
<dd><p>List of available HRTF names.</p>
<p>The order is retained from OpenAL, such that the index of
a given name is the ID to use with <cite>ALC_HRTF_ID_SOFT</cite>.</p>
<p>If the <cite>ALC_SOFT_HRTF</cite> extension is unavailable,
this will be an empty list.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.max_auxiliary_sends">
<em class="property">property </em><code class="sig-name descname">max_auxiliary_sends</code><a class="headerlink" href="#palace.Device.max_auxiliary_sends" title="Permalink to this definition"></a></dt>
<dd><p>Maximum number of auxiliary source sends.</p>
<p>If <cite>ALC_EXT_EFX</cite> is unsupported, this will be 0.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.name">
<em class="property">property </em><code class="sig-name descname">name</code><a class="headerlink" href="#palace.Device.name" title="Permalink to this definition"></a></dt>
<dd><p>Name of the device.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.pause_dsp">
<code class="sig-name descname">pause_dsp</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Device.pause_dsp" title="Permalink to this definition"></a></dt>
<dd><p>Pause device processing and stop contexts updates.</p>
<p>Multiple calls are allowed but it is not reference counted,
so the device will resume after one <cite>resume_dsp</cite> call.</p>
<p>This requires the <cite>ALC_SOFT_pause_device</cite> extension.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.query_extension">
<code class="sig-name descname">query_extension</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#palace.Device.query_extension" title="Permalink to this definition"></a></dt>
<dd><p>Return if an ALC extension exists on this device.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.query_extension" title="palace.query_extension"><code class="xref py py-meth docutils literal notranslate"><span class="pre">query_extension()</span></code></a></dt><dd><p>Query non-device-specific ALC extension</p>
</dd>
</dl>
</div>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">attrs</span><span class="p">:</span> <span class="n">Dict<span class="p">[</span>int<span class="p">, </span>int<span class="p">]</span></span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Device.reset" title="Permalink to this definition"></a></dt>
<dd><p>Reset the device, using the specified attributes.</p>
<p>If the <cite>ALC_SOFT_HRTF</cite> extension is unavailable,
this will be a no-op.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Device.resume_dsp">
<code class="sig-name descname">resume_dsp</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Device.resume_dsp" title="Permalink to this definition"></a></dt>
<dd><p>Resume device processing and restart contexts updates.</p>
<p>Multiple calls are allowed and will no-op.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="device-independent-utilities">
<h2>Device-Independent Utilities<a class="headerlink" href="#device-independent-utilities" title="Permalink to this headline"></a></h2>
<dl class="py data">
<dt id="palace.device_names">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">device_names</code><em class="property">: DeviceNames</em><a class="headerlink" href="#palace.device_names" title="Permalink to this definition"></a></dt>
<dd><p>Read-only namespace of device names by category (<code class="docutils literal notranslate"><span class="pre">basic</span></code>, <code class="docutils literal notranslate"><span class="pre">full</span></code> and
<code class="docutils literal notranslate"><span class="pre">capture</span></code>), as tuples of strings whose first item being the default.</p>
</dd></dl>
<dl class="py function">
<dt id="palace.query_extension">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">query_extension</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span> &#x2192; bool<a class="headerlink" href="#palace.query_extension" title="Permalink to this definition"></a></dt>
<dd><p>Return if a non-device-specific ALC extension exists.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.Device.query_extension" title="palace.Device.query_extension"><code class="xref py py-func docutils literal notranslate"><span class="pre">Device.query_extension()</span></code></a></dt><dd><p>Query ALC extension on a device</p>
</dd>
</dl>
</div>
</dd></dl>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="index.html" title="Previous document">Reference</a>
</li>
<li>
<a href="context.html" title="Next document">Audio Library Contexts</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/device.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

447
html/reference/effect.html Normal file
View File

@ -0,0 +1,447 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Environmental Effects &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Audio Streams" href="decoder.html" />
<link rel="prev" title="Sources &amp; Source Groups" href="source.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="device.html">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="source.html" title="Previous document">Sources &amp; Source Groups</a>
</li>
<li>
<a href="decoder.html" title="Next document">Audio Streams</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="environmental-effects">
<h1>Environmental Effects<a class="headerlink" href="#environmental-effects" title="Permalink to this headline"></a></h1>
<p>For the sake of brevity, we only document the constraints of each effects
properties. Further details can be found at OpenALs <a class="reference external" href="https://kcat.strangesoft.net/misc-downloads/Effects%20Extension%20Guide.pdf">Effect Extension Guide</a>
which specifies the purpose and usage of each value.</p>
<div class="section" id="base-effect">
<h2>Base Effect<a class="headerlink" href="#base-effect" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.BaseEffect">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">BaseEffect</code><a class="headerlink" href="#palace.BaseEffect" title="Permalink to this definition"></a></dt>
<dd><p>Base effect processor.</p>
<p>Instances of this class has no effect (pun intended).</p>
<p>It takes the output mix of zero or more sources,
applies DSP for the desired effect, then adds to the output mix.</p>
<p>This can be used as a context manager that calls <cite>destroy</cite>
upon completion of the block, even if an error occurs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the effect is to be created.
By default <cite>current_context()</cite> is used.</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.ReverbEffect" title="palace.ReverbEffect"><code class="xref py py-class docutils literal notranslate"><span class="pre">ReverbEffect</span></code></a></dt><dd><p>EAXReverb effect</p>
</dd>
<dt><a class="reference internal" href="#palace.ChorusEffect" title="palace.ChorusEffect"><code class="xref py py-class docutils literal notranslate"><span class="pre">ChorusEffect</span></code></a></dt><dd><p>Chorus effect</p>
</dd>
</dl>
</div>
<dl class="py method">
<dt id="palace.BaseEffect.destroy">
<code class="sig-name descname">destroy</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.BaseEffect.destroy" title="Permalink to this definition"></a></dt>
<dd><p>Destroy the effect slot, returning it to the system.</p>
<p>If the effect slot is currently set on a source send,
it will be removed first.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseEffect.slot_gain">
<em class="property">property </em><code class="sig-name descname">slot_gain</code><a class="headerlink" href="#palace.BaseEffect.slot_gain" title="Permalink to this definition"></a></dt>
<dd><p>Gain of the effect slot.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseEffect.source_sends">
<em class="property">property </em><code class="sig-name descname">source_sends</code><a class="headerlink" href="#palace.BaseEffect.source_sends" title="Permalink to this definition"></a></dt>
<dd><p>List of sources using this effect and their pairing sends.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.BaseEffect.use_count">
<em class="property">property </em><code class="sig-name descname">use_count</code><a class="headerlink" href="#palace.BaseEffect.use_count" title="Permalink to this definition"></a></dt>
<dd><p>Number of source sends the effect slot is used by.</p>
<p>This is equivalent to calling <cite>len(self.source_sends)</cite>.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="chorus-effect">
<h2>Chorus Effect<a class="headerlink" href="#chorus-effect" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.ChorusEffect">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">ChorusEffect</code><a class="headerlink" href="#palace.ChorusEffect" title="Permalink to this definition"></a></dt>
<dd><p>Chorus effect.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>waveform</strong> (<em>str</em>) Either sine or triangle.</p></li>
<li><p><strong>phase</strong> (<em>int</em>) From -180 to 180.</p></li>
<li><p><strong>depth</strong> (<em>float</em>) From 0.0 to 1.0.</p></li>
<li><p><strong>feedback</strong> (<em>float</em>) From -1.0 to 1.0.</p></li>
<li><p><strong>delay</strong> (<em>float</em>) From 0.0 to 0.016.</p></li>
<li><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the effect is to be created.
By default <cite>current_context()</cite> is used.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<dl class="py attribute">
<dt id="palace.ChorusEffect.delay">
<code class="sig-name descname">delay</code><a class="headerlink" href="#palace.ChorusEffect.delay" title="Permalink to this definition"></a></dt>
<dd><p>Delay, from 0.0 to 0.016.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ChorusEffect.depth">
<code class="sig-name descname">depth</code><a class="headerlink" href="#palace.ChorusEffect.depth" title="Permalink to this definition"></a></dt>
<dd><p>Depth, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ChorusEffect.feedback">
<code class="sig-name descname">feedback</code><a class="headerlink" href="#palace.ChorusEffect.feedback" title="Permalink to this definition"></a></dt>
<dd><p>Feedback, from -1.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ChorusEffect.phase">
<code class="sig-name descname">phase</code><a class="headerlink" href="#palace.ChorusEffect.phase" title="Permalink to this definition"></a></dt>
<dd><p>Phase, from -180 to 180.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ChorusEffect.waveform">
<code class="sig-name descname">waveform</code><a class="headerlink" href="#palace.ChorusEffect.waveform" title="Permalink to this definition"></a></dt>
<dd><p>Waveform, either sine or triangle.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="reverb-effect">
<h2>Reverb Effect<a class="headerlink" href="#reverb-effect" title="Permalink to this headline"></a></h2>
<dl class="py data">
<dt id="palace.reverb_preset_names">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">reverb_preset_names</code><em class="property">: Tuple[str, ...]</em><a class="headerlink" href="#palace.reverb_preset_names" title="Permalink to this definition"></a></dt>
<dd><p>Names of predefined reverb effect presets in lexicographical order.</p>
</dd></dl>
<dl class="py class">
<dt id="palace.ReverbEffect">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">ReverbEffect</code><a class="headerlink" href="#palace.ReverbEffect" title="Permalink to this definition"></a></dt>
<dd><p>EAXReverb effect.</p>
<p>It will automatically downgrade to the Standard Reverb effect
if EAXReverb effect is not supported.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>preset</strong> (<em>str</em><em>, </em><em>optional</em>) The initial preset to start with, falling back to GENERIC.</p></li>
<li><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the effect is to be created.
By default <cite>current_context()</cite> is used.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>ValueError</strong> If the specified preset cannot be found in <cite>reverb_preset_names</cite>.</p></li>
<li><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.air_absorption_gain_hf">
<code class="sig-name descname">air_absorption_gain_hf</code><a class="headerlink" href="#palace.ReverbEffect.air_absorption_gain_hf" title="Permalink to this definition"></a></dt>
<dd><p>High frequency air absorption gain, from 0.892 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.decay_hf_limit">
<code class="sig-name descname">decay_hf_limit</code><a class="headerlink" href="#palace.ReverbEffect.decay_hf_limit" title="Permalink to this definition"></a></dt>
<dd><p>High frequency decay limit.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.decay_hf_ratio">
<code class="sig-name descname">decay_hf_ratio</code><a class="headerlink" href="#palace.ReverbEffect.decay_hf_ratio" title="Permalink to this definition"></a></dt>
<dd><p>High frequency decay ratio, from 0.1 to 20.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.decay_lf_ratio">
<code class="sig-name descname">decay_lf_ratio</code><a class="headerlink" href="#palace.ReverbEffect.decay_lf_ratio" title="Permalink to this definition"></a></dt>
<dd><p>Low frequency decay ratio, from 0.1 to 20.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.decay_time">
<code class="sig-name descname">decay_time</code><a class="headerlink" href="#palace.ReverbEffect.decay_time" title="Permalink to this definition"></a></dt>
<dd><p>Decay time, from 0.1 to 20.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.density">
<code class="sig-name descname">density</code><a class="headerlink" href="#palace.ReverbEffect.density" title="Permalink to this definition"></a></dt>
<dd><p>Density, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.diffusion">
<code class="sig-name descname">diffusion</code><a class="headerlink" href="#palace.ReverbEffect.diffusion" title="Permalink to this definition"></a></dt>
<dd><p>Diffusion, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.echo_depth">
<code class="sig-name descname">echo_depth</code><a class="headerlink" href="#palace.ReverbEffect.echo_depth" title="Permalink to this definition"></a></dt>
<dd><p>Echo depth, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.echo_time">
<code class="sig-name descname">echo_time</code><a class="headerlink" href="#palace.ReverbEffect.echo_time" title="Permalink to this definition"></a></dt>
<dd><p>Echo time, from 0.075 to 0.25.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.gain">
<code class="sig-name descname">gain</code><a class="headerlink" href="#palace.ReverbEffect.gain" title="Permalink to this definition"></a></dt>
<dd><p>Gain, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.gain_hf">
<code class="sig-name descname">gain_hf</code><a class="headerlink" href="#palace.ReverbEffect.gain_hf" title="Permalink to this definition"></a></dt>
<dd><p>High frequency gain, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.gain_lf">
<code class="sig-name descname">gain_lf</code><a class="headerlink" href="#palace.ReverbEffect.gain_lf" title="Permalink to this definition"></a></dt>
<dd><p>Low frequency gain, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.hf_reference">
<code class="sig-name descname">hf_reference</code><a class="headerlink" href="#palace.ReverbEffect.hf_reference" title="Permalink to this definition"></a></dt>
<dd><p>High frequency reference, from 1000.0 to 20000.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.late_reverb_delay">
<code class="sig-name descname">late_reverb_delay</code><a class="headerlink" href="#palace.ReverbEffect.late_reverb_delay" title="Permalink to this definition"></a></dt>
<dd><p>Late reverb delay, from 0.0 to 0.1.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.late_reverb_gain">
<code class="sig-name descname">late_reverb_gain</code><a class="headerlink" href="#palace.ReverbEffect.late_reverb_gain" title="Permalink to this definition"></a></dt>
<dd><p>Late reverb gain, from 0.0 to 10.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.late_reverb_pan">
<code class="sig-name descname">late_reverb_pan</code><a class="headerlink" href="#palace.ReverbEffect.late_reverb_pan" title="Permalink to this definition"></a></dt>
<dd><p>Late reverb as 3D vector of magnitude between 0 and 1.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.lf_reference">
<code class="sig-name descname">lf_reference</code><a class="headerlink" href="#palace.ReverbEffect.lf_reference" title="Permalink to this definition"></a></dt>
<dd><p>Low frequency reference, from 20.0 to 1000.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.modulation_depth">
<code class="sig-name descname">modulation_depth</code><a class="headerlink" href="#palace.ReverbEffect.modulation_depth" title="Permalink to this definition"></a></dt>
<dd><p>Modulation depth, from 0.0 to 1.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.modulation_time">
<code class="sig-name descname">modulation_time</code><a class="headerlink" href="#palace.ReverbEffect.modulation_time" title="Permalink to this definition"></a></dt>
<dd><p>Modulation time, from 0.004 to 4.0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.reflections_delay">
<code class="sig-name descname">reflections_delay</code><a class="headerlink" href="#palace.ReverbEffect.reflections_delay" title="Permalink to this definition"></a></dt>
<dd><p>Reflections delay, from 0.0 to 0.3.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.reflections_gain">
<code class="sig-name descname">reflections_gain</code><a class="headerlink" href="#palace.ReverbEffect.reflections_gain" title="Permalink to this definition"></a></dt>
<dd><p>Reflections gain, from 0.0 to 3.16.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.reflections_pan">
<code class="sig-name descname">reflections_pan</code><a class="headerlink" href="#palace.ReverbEffect.reflections_pan" title="Permalink to this definition"></a></dt>
<dd><p>Reflections as 3D vector of magnitude between 0 and 1.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.ReverbEffect.room_rolloff_factor">
<code class="sig-name descname">room_rolloff_factor</code><a class="headerlink" href="#palace.ReverbEffect.room_rolloff_factor" title="Permalink to this definition"></a></dt>
<dd><p>Room rolloff factor, from 0.0 to 10.0.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.ReverbEffect.send_auto">
<em class="property">property </em><code class="sig-name descname">send_auto</code><a class="headerlink" href="#palace.ReverbEffect.send_auto" title="Permalink to this definition"></a></dt>
<dd><p>Whether to automatically adjust send slot gains.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="source.html" title="Previous document">Sources &amp; Source Groups</a>
</li>
<li>
<a href="decoder.html" title="Next document">Audio Streams</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/effect.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

210
html/reference/file-io.html Normal file
View File

@ -0,0 +1,210 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>File I/O Interface &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Design Principles" href="../design.html" />
<link rel="prev" title="Audio Streams" href="decoder.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="device.html">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html">Audio Streams</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="decoder.html" title="Previous document">Audio Streams</a>
</li>
<li>
<a href="../design.html" title="Next document">Design Principles</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="file-i-o-interface">
<h1>File I/O Interface<a class="headerlink" href="#file-i-o-interface" title="Permalink to this headline"></a></h1>
<dl class="py function">
<dt id="palace.current_fileio">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">current_fileio</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; Optional<span class="p">[</span>Callable<span class="p">[</span><span class="p">[</span>str<span class="p">]</span><span class="p">, </span><a class="reference internal" href="#palace.FileIO" title="palace.FileIO">palace.FileIO</a><span class="p">]</span><span class="p">]</span><a class="headerlink" href="#palace.current_fileio" title="Permalink to this definition"></a></dt>
<dd><p>Return the file I/O factory currently in used by audio decoders.</p>
<p>If the default is being used, return <cite>None</cite>.</p>
</dd></dl>
<dl class="py function">
<dt id="palace.use_fileio">
<code class="sig-prename descclassname">palace.</code><code class="sig-name descname">use_fileio</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">factory</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>Callable<span class="p">[</span><span class="p">[</span>str<span class="p">]</span><span class="p">, </span>FileIO<span class="p">]</span><span class="p">]</span></span></em>, <em class="sig-param"><span class="n">buffer_size</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">8192</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.use_fileio" title="Permalink to this definition"></a></dt>
<dd><p>Set the file I/O factory instance to be used by audio decoders.</p>
<p>If <cite>factory=None</cite> is provided, revert to the default.</p>
</dd></dl>
<dl class="py class">
<dt id="palace.FileIO">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">FileIO</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#palace.FileIO" title="Permalink to this definition"></a></dt>
<dd><p>File I/O protocol.</p>
<p>This static duck type defines methods required to be used by
palace decoders. Despite its name, a <cite>FileIO</cite> is not necessarily
created from a file, but any seekable finite input stream.</p>
<p>Many classes defined in the standard library module <cite>io</cite>
are compatible with this protocol.</p>
<p class="rubric">Notes</p>
<p>Since PEP 544 is only implemented in Python 3.8+, type checking
for this on earlier Python version might not work as expected.</p>
<dl class="py method">
<dt id="palace.FileIO.close">
<em class="property">abstract </em><code class="sig-name descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.FileIO.close" title="Permalink to this definition"></a></dt>
<dd><p>Close the file.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.FileIO.read">
<em class="property">abstract </em><code class="sig-name descname">read</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">size</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; bytes<a class="headerlink" href="#palace.FileIO.read" title="Permalink to this definition"></a></dt>
<dd><p>Read at most size bytes, returned as bytes.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.FileIO.seek">
<em class="property">abstract </em><code class="sig-name descname">seek</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">offset</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">whence</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">0</span></em><span class="sig-paren">)</span> &#x2192; int<a class="headerlink" href="#palace.FileIO.seek" title="Permalink to this definition"></a></dt>
<dd><p>Move to new file position and return the file position.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>offset</strong> (<em>int</em>) A byte count.</p></li>
<li><p><strong>whence</strong> (<em>int</em><em>, </em><em>optional</em>) Either 0 (default, move relative to start of file),
1 (move relative to current position)
or 2 (move relative to end of file).</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="decoder.html" title="Previous document">Audio Streams</a>
</li>
<li>
<a href="../design.html" title="Next document">Design Principles</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/file-io.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

193
html/reference/index.html Normal file
View File

@ -0,0 +1,193 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Reference &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Audio Devices" href="device.html" />
<link rel="prev" title="Play an Audio" href="../tutorial/play-audio.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="device.html">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html">Resource Caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="../tutorial/play-audio.html" title="Previous document">Play an Audio</a>
</li>
<li>
<a href="device.html" title="Next document">Audio Devices</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="reference">
<h1>Reference<a class="headerlink" href="#reference" title="Permalink to this headline"></a></h1>
<p>API reference is divided into the following sections:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="device.html">Audio Devices</a><ul>
<li class="toctree-l2"><a class="reference internal" href="device.html#device-dependent-utilities">Device-Dependent Utilities</a></li>
<li class="toctree-l2"><a class="reference internal" href="device.html#device-independent-utilities">Device-Independent Utilities</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="context.html">Audio Library Contexts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="context.html#context-and-auxiliary-classes">Context and Auxiliary Classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html#using-contexts">Using Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html#context-creation-attributes">Context Creation Attributes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="buffer.html">Resource Caching</a><ul>
<li class="toctree-l2"><a class="reference internal" href="buffer.html#audio-buffers">Audio Buffers</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html#loading-freeing-in-batch">Loading &amp; Freeing in Batch</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="source.html">Sources &amp; Source Groups</a><ul>
<li class="toctree-l2"><a class="reference internal" href="source.html#sources">Sources</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html#source-groups">Source Groups</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="effect.html">Environmental Effects</a><ul>
<li class="toctree-l2"><a class="reference internal" href="effect.html#base-effect">Base Effect</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html#chorus-effect">Chorus Effect</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html#reverb-effect">Reverb Effect</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="decoder.html">Audio Streams</a><ul>
<li class="toctree-l2"><a class="reference internal" href="decoder.html#builtin-decoders">Builtin Decoders</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html#decoder-interface">Decoder Interface</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html#miscellaneous">Miscellaneous</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="../tutorial/play-audio.html" title="Previous document">Play an Audio</a>
</li>
<li>
<a href="device.html" title="Next document">Audio Devices</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/index.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

654
html/reference/source.html Normal file
View File

@ -0,0 +1,654 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Sources &amp; Source Groups &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Environmental Effects" href="effect.html" />
<link rel="prev" title="Resource Caching" href="buffer.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="device.html">Audio Devices</a></li>
<li class="toctree-l2"><a class="reference internal" href="context.html">Audio Library Contexts</a></li>
<li class="toctree-l2"><a class="reference internal" href="buffer.html">Resource Caching</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Sources &amp; Source Groups</a></li>
<li class="toctree-l2"><a class="reference internal" href="effect.html">Environmental Effects</a></li>
<li class="toctree-l2"><a class="reference internal" href="decoder.html">Audio Streams</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-io.html">File I/O Interface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="buffer.html" title="Previous document">Resource Caching</a>
</li>
<li>
<a href="effect.html" title="Next document">Environmental Effects</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="sources-source-groups">
<h1>Sources &amp; Source Groups<a class="headerlink" href="#sources-source-groups" title="Permalink to this headline"></a></h1>
<div class="section" id="sources">
<h2>Sources<a class="headerlink" href="#sources" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.Source">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">Source</code><a class="headerlink" href="#palace.Source" title="Permalink to this definition"></a></dt>
<dd><p>Sound source for playing audio.</p>
<p>There is no practical limit to the number of sources one may create.</p>
<p>When the source is no longer needed, <cite>destroy</cite> must be called,
unless the context manager is used, which guarantees the sources
destructioni upon completion of the block, even if an error occurs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the source is to be created.
By default <cite>current_context()</cite> is used.</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<dl class="py attribute">
<dt id="palace.Source.air_absorption_factor">
<code class="sig-name descname">air_absorption_factor</code><a class="headerlink" href="#palace.Source.air_absorption_factor" title="Permalink to this definition"></a></dt>
<dd><p>Multiplier for atmospheric high-frequency absorption</p>
<p>Its value ranging from 0 to 10. A factor of 1 results in
a nominal -0.05 dB per meter, with higher values simulating
foggy air and lower values simulating dryer air; default to 0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.cone_angles">
<code class="sig-name descname">cone_angles</code><a class="headerlink" href="#palace.Source.cone_angles" title="Permalink to this definition"></a></dt>
<dd><p>Cone inner and outer angles in degrees.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>inner</strong> (<em>float</em>) The area within which the listener will hear the source
without extra attenuation, default to 360.</p></li>
<li><p><strong>outer</strong> (<em>float</em>) The area outside of which the listener will hear the source
attenuated according to <cite>outer_cone_gains</cite>, default to 360.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> If set to a value where <cite>inner</cite> is greater than <cite>outer</cite>
or either of them is outside of the [0, 360] interval.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>The areas follow the facing direction, so for example
an inner angle of 180 means the entire front face of
the source is in the inner cone.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.destroy">
<code class="sig-name descname">destroy</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Source.destroy" title="Permalink to this definition"></a></dt>
<dd><p>Destroy the source, stop playback and release resources.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.distance_range">
<code class="sig-name descname">distance_range</code><a class="headerlink" href="#palace.Source.distance_range" title="Permalink to this definition"></a></dt>
<dd><p>Reference and maximum distance for current distance model.</p>
<p>For Clamped distance models, the sources calculated
distance is clamped to the specified range before applying
distance-related attenuation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>refdist</strong> (<em>float</em>) The distance at which the sources volume will not have
any extra attenuation (an effective gain multiplier of 1),
default to 0.</p></li>
<li><p><strong>maxdist</strong> (<em>float</em>) The maximum distance, default to FLT_MAX, which is the
maximum value of a single-precision floating-point variable
(2**128 - 2**104).</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> If set to a value where <cite>refdist</cite> is greater than <cite>maxdist</cite>
or either of them is outside of the [0, FLT_MAX] interval.</p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.doppler_factor">
<code class="sig-name descname">doppler_factor</code><a class="headerlink" href="#palace.Source.doppler_factor" title="Permalink to this definition"></a></dt>
<dd><p>The doppler factor for the doppler effects pitch shift.</p>
<p>This effectively scales the source and listener velocities
for the doppler calculation.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> If set to a value outside of the [0, 1] interval.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.fade_out_to_stop">
<code class="sig-name descname">fade_out_to_stop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gain</span><span class="p">:</span> <span class="n">float</span></em>, <em class="sig-param"><span class="n">ms</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Source.fade_out_to_stop" title="Permalink to this definition"></a></dt>
<dd><p>Fade the source to <cite>gain</cite> over <cite>ms</cite> milliseconds.</p>
<p><cite>gain</cite> is in addition to the base gain and must be within
the [0, 1] interval. <cite>ms</cite> must be positive.</p>
<p>The fading is logarithmic. As a result, the initial drop-off
may happen faster than expected but the fading is more
perceptually consistant over the given duration. It will take
just as much time to go from -6 dB to -12 dB as it will to go
from -40 dB to -46 dB, for example.</p>
<p>Fading is updated during calls to <cite>Context.update</cite>,
which should be called regularly (30 to 50 times per second)
for the fading to be smooth.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.filter">
<em class="property">property </em><code class="sig-name descname">filter</code><a class="headerlink" href="#palace.Source.filter" title="Permalink to this definition"></a></dt>
<dd><p>Linear gains on the direct path signal, clamped to [0, 1].</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gain</strong> (<em>float</em>) Linear gain applying to all frequencies, default to 1.</p></li>
<li><p><strong>gain_hf</strong> (<em>float</em>) Linear gain applying to high frequencies, default to 1.</p></li>
<li><p><strong>gain_lf</strong> (<em>float</em>) Linear gain applying to low frequencies, default to 1.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.gain">
<code class="sig-name descname">gain</code><a class="headerlink" href="#palace.Source.gain" title="Permalink to this definition"></a></dt>
<dd><p>Base linear volume gain, default to 1.0.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> If set to a negative value.</p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.gain_auto">
<code class="sig-name descname">gain_auto</code><a class="headerlink" href="#palace.Source.gain_auto" title="Permalink to this definition"></a></dt>
<dd><p>Whether automatically adjust gains.</p>
<p>Respectively for direct paths high frequency gain,
send paths gain and send paths high-frequency gain are
automatically adjusted. The default is <cite>True</cite> for all.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.gain_range">
<code class="sig-name descname">gain_range</code><a class="headerlink" href="#palace.Source.gain_range" title="Permalink to this definition"></a></dt>
<dd><p>The range which the sources gain is clamped to.</p>
<p>This is used after distance and cone attenuation are applied
to the gain base and before the adjustments of the filter gain.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mingain</strong> (<em>float</em>) Minimum gain, default to 0.</p></li>
<li><p><strong>maxgain</strong> (<em>float</em>) Maximum gain, default to 1.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> If set to a value where <cite>mingain</cite> is greater than <cite>maxgain</cite>
or either of them is outside of the [0, 1] interval.</p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.group">
<code class="sig-name descname">group</code><a class="headerlink" href="#palace.Source.group" title="Permalink to this definition"></a></dt>
<dd><p>Parent group of this source.</p>
<p>The parent group influences all sources that belong to it.
A source may only be the child of one <cite>SourceGroup</cite> at a time,
although that source group may belong to another source group.</p>
<p>This is <cite>None</cite> when the source does not belong to any group.
On the other hand, setting it to <cite>None</cite> removes the source
from its current group.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#palace.SourceGroup" title="palace.SourceGroup"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SourceGroup</span></code></a></dt><dd><p>A group of <cite>Source</cite> references</p>
</dd>
</dl>
</div>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.latency">
<em class="property">property </em><code class="sig-name descname">latency</code><a class="headerlink" href="#palace.Source.latency" title="Permalink to this definition"></a></dt>
<dd><p>Source latency in nanoseconds.</p>
<p>If the <cite>AL_SOFT_source_latency</cite> extension is unsupported,
the latency will be 0.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.latency_seconds">
<em class="property">property </em><code class="sig-name descname">latency_seconds</code><a class="headerlink" href="#palace.Source.latency_seconds" title="Permalink to this definition"></a></dt>
<dd><p>Source latency in seconds.</p>
<p>If the <cite>AL_SOFT_source_latency</cite> extension is unsupported,
the latency will be 0.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.looping">
<code class="sig-name descname">looping</code><a class="headerlink" href="#palace.Source.looping" title="Permalink to this definition"></a></dt>
<dd><p>Whether the source should loop.</p>
<p>The loop points are determined by the playing buffer or decoder.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.offset">
<code class="sig-name descname">offset</code><a class="headerlink" href="#palace.Source.offset" title="Permalink to this definition"></a></dt>
<dd><p>Source offset in sample frames. For streaming sources
this will be the offset based on the decoders read position.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.offset_seconds">
<em class="property">property </em><code class="sig-name descname">offset_seconds</code><a class="headerlink" href="#palace.Source.offset_seconds" title="Permalink to this definition"></a></dt>
<dd><p>Source offset in seconds.</p>
<p>For streaming sources this will be the offset based on
the decoders read position.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.orientation">
<code class="sig-name descname">orientation</code><a class="headerlink" href="#palace.Source.orientation" title="Permalink to this definition"></a></dt>
<dd><p>3D orientation of the source.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>at</strong> (<em>Tuple</em><em>[</em><em>float</em><em>, </em><em>float</em><em>, </em><em>float</em><em>]</em>) Relative position.</p></li>
<li><p><strong>up</strong> (<em>Tuple</em><em>[</em><em>float</em><em>, </em><em>float</em><em>, </em><em>float</em><em>]</em>) Relative direction.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>Unlike the <cite>AL_EXT_BFORMAT</cite> extension this property
comes from, this also affects the facing direction.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.outer_cone_gains">
<code class="sig-name descname">outer_cone_gains</code><a class="headerlink" href="#palace.Source.outer_cone_gains" title="Permalink to this definition"></a></dt>
<dd><p>Gain when listener is out of the sources outer cone area.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>gain</strong> (<em>float</em>) Linear gain applying to all frequencies, default to 1.</p></li>
<li><p><strong>gain_hf</strong> (<em>float</em>) Linear gain applying extra attenuation to high frequencies
creating a low-pass effect, default to 1. It has no effect
without the <cite>ALC_EXT_EFX</cite> extension.</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> If either of the gains is set to a value
outside of the [0, 1] interval.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.pause">
<code class="sig-name descname">pause</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Source.pause" title="Permalink to this definition"></a></dt>
<dd><p>Pause the source if it is playing.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.paused">
<em class="property">property </em><code class="sig-name descname">paused</code><a class="headerlink" href="#palace.Source.paused" title="Permalink to this definition"></a></dt>
<dd><p>Whether the source is currently paused.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.pitch">
<code class="sig-name descname">pitch</code><a class="headerlink" href="#palace.Source.pitch" title="Permalink to this definition"></a></dt>
<dd><p>Linear pitch shift base, default to 1.0.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> If set to a nonpositive value.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.playing">
<em class="property">property </em><code class="sig-name descname">playing</code><a class="headerlink" href="#palace.Source.playing" title="Permalink to this definition"></a></dt>
<dd><p>Whether the source is currently playing.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.position">
<code class="sig-name descname">position</code><a class="headerlink" href="#palace.Source.position" title="Permalink to this definition"></a></dt>
<dd><p>3D position of the source.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.priority">
<code class="sig-name descname">priority</code><a class="headerlink" href="#palace.Source.priority" title="Permalink to this definition"></a></dt>
<dd><p>Playback priority (natural number).</p>
<p>The lowest priority sources will be forcefully stopped
when no more mixing sources are available and higher priority
sources are played.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.radius">
<code class="sig-name descname">radius</code><a class="headerlink" href="#palace.Source.radius" title="Permalink to this definition"></a></dt>
<dd><p>Radius of the source, as if it is a sound-emitting sphere.</p>
<p>This has no effect without the <cite>AL_EXT_SOURCE_RADIUS</cite> extension.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> If set to a negative value.</p>
</dd>
</dl>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.relative">
<code class="sig-name descname">relative</code><a class="headerlink" href="#palace.Source.relative" title="Permalink to this definition"></a></dt>
<dd><p>Whether the sources 3D parameters are relative to listener.</p>
<p>The affected parameters includes <cite>position</cite>, <cite>velocity</cite>,
and <cite>orientation</cite>.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.resampler_index">
<code class="sig-name descname">resampler_index</code><a class="headerlink" href="#palace.Source.resampler_index" title="Permalink to this definition"></a></dt>
<dd><p>Index of the resampler to use for this source.</p>
<p>The index must be nonnegative, from the resamplers returned
by <cite>Context.get_available_resamplers</cite>, and has no effect
without the <cite>AL_SOFT_source_resampler</cite> extension.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.resume">
<code class="sig-name descname">resume</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Source.resume" title="Permalink to this definition"></a></dt>
<dd><p>Resume the source if it is paused.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.rolloff_factors">
<code class="sig-name descname">rolloff_factors</code><a class="headerlink" href="#palace.Source.rolloff_factors" title="Permalink to this definition"></a></dt>
<dd><p>Rolloff factor and room factor for the direct and send paths.</p>
<p>This is effectively a distance scaling relative to
the reference distance.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> If either of rolloff factors is set to a negative value.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>To disable distance attenuation for send paths,
set room factor to 0. The reverb engine will, by default,
apply a more realistic room decay based on the reverb decay
time and distance.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.sends">
<em class="property">property </em><code class="sig-name descname">sends</code><a class="headerlink" href="#palace.Source.sends" title="Permalink to this definition"></a></dt>
<dd><p>Collection of send path signals.</p>
<p>Send paths can be retrieved using a nonnegative index, which has
no effect if not less than the devices <cite>max_auxiliary_sends</cite>.</p>
<p>Each send path has two write-only descriptors,
<cite>effect</cite> and <cite>filter</cite>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">source</span><span class="o">.</span><span class="n">sends</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">effect</span> <span class="o">=</span> <span class="n">effect</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">source</span><span class="o">.</span><span class="n">sends</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">filter</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span> <span class="mf">0.6</span><span class="p">,</span> <span class="mf">0.9</span>
</pre></div>
</div>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.spatialize">
<code class="sig-name descname">spatialize</code><a class="headerlink" href="#palace.Source.spatialize" title="Permalink to this definition"></a></dt>
<dd><p>Whether to enable 3D spatialization.</p>
<p>Either <cite>True</cite> (the source always has 3D spatialization
features), <cite>False</cite> (never has 3D spatialization features),
or <cite>None</cite> (spatialization is enabled based on playing
a mono sound or not, default).</p>
<p>This has no effect without
the <cite>AL_SOFT_source_spatialize</cite> extension.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.stereo_angles">
<code class="sig-name descname">stereo_angles</code><a class="headerlink" href="#palace.Source.stereo_angles" title="Permalink to this definition"></a></dt>
<dd><p>Left and right channel angles, in radians.</p>
<p>The angles go counter-clockwise, with 0 being in front
and positive values going left.</p>
<p>This is only used for stereo playback and has no effect
without the <cite>AL_EXT_STEREO_ANGLES</cite> extension.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.Source.stop">
<code class="sig-name descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.Source.stop" title="Permalink to this definition"></a></dt>
<dd><p>Stop playback, releasing the buffer or decoder reference.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.Source.velocity">
<code class="sig-name descname">velocity</code><a class="headerlink" href="#palace.Source.velocity" title="Permalink to this definition"></a></dt>
<dd><p>3D velocity in units per second.</p>
<p>As with OpenAL, this does not actually alter the sources
position, and instead just alters the pitch as determined
by the doppler effect.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="source-groups">
<h2>Source Groups<a class="headerlink" href="#source-groups" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt id="palace.SourceGroup">
<em class="property">class </em><code class="sig-prename descclassname">palace.</code><code class="sig-name descname">SourceGroup</code><a class="headerlink" href="#palace.SourceGroup" title="Permalink to this definition"></a></dt>
<dd><p>A group of <cite>Source</cite> references.</p>
<p>For instance, setting <cite>SourceGroup.gain</cite> to 0.5 will halve the gain
of all sources in the group.</p>
<p>This can be used as a context manager that calls <cite>destroy</cite> upon
completion of the block, even if an error occurs.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>context</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="context.html#palace.Context" title="palace.Context"><em>Context</em></a><em>]</em><em>, </em><em>optional</em>) The context from which the source group is to be created.
By default <cite>current_context()</cite> is used.</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>RuntimeError</strong> If there is neither any context specified nor current.</p>
</dd>
</dl>
<dl class="py method">
<dt id="palace.SourceGroup.destroy">
<code class="sig-name descname">destroy</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.SourceGroup.destroy" title="Permalink to this definition"></a></dt>
<dd><p>Destroy the source group, remove and free all sources.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.SourceGroup.gain">
<code class="sig-name descname">gain</code><a class="headerlink" href="#palace.SourceGroup.gain" title="Permalink to this definition"></a></dt>
<dd><p>Source group gain.</p>
<p>This accumulates with its sources and sub-groups gain.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.SourceGroup.parent_group">
<code class="sig-name descname">parent_group</code><a class="headerlink" href="#palace.SourceGroup.parent_group" title="Permalink to this definition"></a></dt>
<dd><p>The source group this source group is a child of.</p>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>RuntimeException</strong> If this group is being added to its sub-group
(i.e. it would create a circular sub-group chain).</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="palace.SourceGroup.pause_all">
<code class="sig-name descname">pause_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.SourceGroup.pause_all" title="Permalink to this definition"></a></dt>
<dd><p>Pause all currently-playing sources under this group.</p>
<p>This is done recursively, including sub-groups.</p>
</dd></dl>
<dl class="py attribute">
<dt id="palace.SourceGroup.pitch">
<code class="sig-name descname">pitch</code><a class="headerlink" href="#palace.SourceGroup.pitch" title="Permalink to this definition"></a></dt>
<dd><p>Source group pitch.</p>
<p>This accumulates with its sources and sub-groups pitch.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.SourceGroup.resume_all">
<code class="sig-name descname">resume_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.SourceGroup.resume_all" title="Permalink to this definition"></a></dt>
<dd><p>Resume all currently-playing sources under this group.</p>
<p>This is done recursively, including sub-groups.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.SourceGroup.sources">
<em class="property">property </em><code class="sig-name descname">sources</code><a class="headerlink" href="#palace.SourceGroup.sources" title="Permalink to this definition"></a></dt>
<dd><p>Sources under this group.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.SourceGroup.stop_all">
<code class="sig-name descname">stop_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None<a class="headerlink" href="#palace.SourceGroup.stop_all" title="Permalink to this definition"></a></dt>
<dd><p>Stop all currently-playing sources under this group.</p>
<p>This is done recursively, including sub-groups.</p>
</dd></dl>
<dl class="py method">
<dt id="palace.SourceGroup.sub_groups">
<em class="property">property </em><code class="sig-name descname">sub_groups</code><a class="headerlink" href="#palace.SourceGroup.sub_groups" title="Permalink to this definition"></a></dt>
<dd><p>Source groups under this group.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="buffer.html" title="Previous document">Resource Caching</a>
</li>
<li>
<a href="effect.html" title="Next document">Environmental Effects</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/reference/source.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

View File

@ -34,7 +34,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/index.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="copying.html">Copying</a></li>
@ -63,6 +63,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
</div>
</div>

File diff suppressed because one or more lines are too long

View File

@ -1,150 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Tutorial &#8212; palace 0.2.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Context creation" href="tutorial/context.html" />
<link rel="prev" title="Installation" href="installation.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial/context.html">Context creation</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial/play-audio.html">Play an audio</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="copying.html">Copying</a></li>
</ul>
<h3>Quick Navigation</h3>
<ul>
<li class="toctree-l1">
<a class="reference external" href="https://pypi.org/project/palace/">
Python Package Index
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://travis-ci.com/github/McSinyx/palace">
Travis CI Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://ci.appveyor.com/project/McSinyx/palace">
AppVeyor Build
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/McSinyx/palace">
GitHub Repository
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="related top">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="installation.html" title="Previous document">Installation</a>
</li>
<li>
<a href="tutorial/context.html" title="Next document">Context creation</a>
&rarr;
</li>
</ul>
</nav>
</div>
<div class="body" role="main">
<div class="section" id="tutorial">
<h1>Tutorial<a class="headerlink" href="#tutorial" title="Permalink to this headline"></a></h1>
<p>This tutorial will guide you on:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorial/context.html">Context creation</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/play-audio.html">Play an audio</a></li>
</ul>
</div>
</div>
</div>
<div class="related bottom">
&nbsp;
<nav id="rellinks">
<ul>
<li>
&larr;
<a href="installation.html" title="Previous document">Installation</a>
</li>
<li>
<a href="tutorial/context.html" title="Next document">Context creation</a>
&rarr;
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, 2020 Nguyễn Gia Phong et al.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.3</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/tutorial.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

View File

@ -35,7 +35,7 @@
<li class="toctree-l2"><a class="reference internal" href="play-audio.html">Play an Audio</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
@ -64,6 +64,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
@ -109,16 +115,16 @@ such as sources, buffers, and effects.</p>
<p>To create a context, we must first create a device,
since its a parameter of the context object.</p>
<p>To create an object, well, you just have to instantiate
the <a class="reference internal" href="../reference.html#palace.Device" title="palace.Device"><code class="xref py py-class docutils literal notranslate"><span class="pre">Device</span></code></a> class.</p>
the <a class="reference internal" href="../reference/device.html#palace.Device" title="palace.Device"><code class="xref py py-class docutils literal notranslate"><span class="pre">Device</span></code></a> class.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">palace</span> <span class="kn">import</span> <span class="n">Device</span>
<span class="k">with</span> <span class="n">Device</span><span class="p">()</span> <span class="k">as</span> <span class="n">dev</span><span class="p">:</span>
<span class="c1"># Your code goes here</span>
</pre></div>
</div>
<p>This is how you declare a <a class="reference internal" href="../reference.html#palace.Device" title="palace.Device"><code class="xref py py-class docutils literal notranslate"><span class="pre">Device</span></code></a> object with the default device.
<p>This is how you declare a <a class="reference internal" href="../reference/device.html#palace.Device" title="palace.Device"><code class="xref py py-class docutils literal notranslate"><span class="pre">Device</span></code></a> object with the default device.
There can be several devices available, which can be found
in <a class="reference internal" href="../reference.html#palace.device_names" title="palace.device_names"><code class="xref py py-data docutils literal notranslate"><span class="pre">device_names</span></code></a>.</p>
in <a class="reference internal" href="../reference/device.html#palace.device_names" title="palace.device_names"><code class="xref py py-data docutils literal notranslate"><span class="pre">device_names</span></code></a>.</p>
</div>
<div class="section" id="creating-a-context">
<h2>Creating a Context<a class="headerlink" href="#creating-a-context" title="Permalink to this headline"></a></h2>

View File

@ -35,7 +35,7 @@
<li class="toctree-l2"><a class="reference internal" href="play-audio.html">Play an Audio</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
@ -64,6 +64,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>

View File

@ -14,7 +14,7 @@
<script src="../_static/language_data.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Reference" href="../reference.html" />
<link rel="next" title="Reference" href="../reference/index.html" />
<link rel="prev" title="Context Creation" href="context.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
@ -35,7 +35,7 @@
<li class="toctree-l2 current"><a class="current reference internal" href="#">Play an Audio</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/index.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../design.html">Design Principles</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Getting Involved</a></li>
<li class="toctree-l1"><a class="reference internal" href="../copying.html">Copying</a></li>
@ -64,6 +64,12 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
@ -88,7 +94,7 @@
<a href="context.html" title="Previous document">Context Creation</a>
</li>
<li>
<a href="../reference.html" title="Next document">Reference</a>
<a href="../reference/index.html" title="Next document">Reference</a>
&rarr;
</li>
</ul>
@ -114,14 +120,14 @@ can be changed to create desired effects.</p>
<span class="c1"># to be written</span>
</pre></div>
</div>
<p>Just like for the case of <a class="reference internal" href="../reference.html#palace.Context" title="palace.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a>, <a class="reference internal" href="../reference.html#palace.Source" title="palace.Source"><code class="xref py py-class docutils literal notranslate"><span class="pre">Source</span></code></a> creation
<p>Just like for the case of <a class="reference internal" href="../reference/context.html#palace.Context" title="palace.Context"><code class="xref py py-class docutils literal notranslate"><span class="pre">Context</span></code></a>, <a class="reference internal" href="../reference/source.html#palace.Source" title="palace.Source"><code class="xref py py-class docutils literal notranslate"><span class="pre">Source</span></code></a> creation
requires a context, but here the context is passed implicitly.</p>
</div>
<div class="section" id="decode-the-audio-file">
<h2>Decode the Audio File<a class="headerlink" href="#decode-the-audio-file" title="Permalink to this headline"></a></h2>
<p>Palace has a module level function <a class="reference internal" href="../reference.html#palace.decode" title="palace.decode"><code class="xref py py-func docutils literal notranslate"><span class="pre">decode()</span></code></a>, which decodes audio file
automatically, and this decoded file is a <a class="reference internal" href="../reference.html#palace.Decoder" title="palace.Decoder"><code class="xref py py-class docutils literal notranslate"><span class="pre">Decoder</span></code></a> object. This object
can be played by a simple <a class="reference internal" href="../reference.html#palace.Decoder.play" title="palace.Decoder.play"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Decoder.play()</span></code></a> method.</p>
<p>Palace has a module level function <a class="reference internal" href="../reference/decoder.html#palace.decode" title="palace.decode"><code class="xref py py-func docutils literal notranslate"><span class="pre">decode()</span></code></a>, which decodes audio file
automatically, and this decoded file is a <a class="reference internal" href="../reference/decoder.html#palace.Decoder" title="palace.Decoder"><code class="xref py py-class docutils literal notranslate"><span class="pre">Decoder</span></code></a> object. This object
can be played by a simple <a class="reference internal" href="../reference/decoder.html#palace.Decoder.play" title="palace.Decoder.play"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Decoder.play()</span></code></a> method.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">palace</span> <span class="kn">import</span> <span class="n">Device</span><span class="p">,</span> <span class="n">Context</span><span class="p">,</span> <span class="n">Source</span><span class="p">,</span> <span class="n">decode</span>
<span class="n">filename</span> <span class="o">=</span> <span class="s1">&#39;some_audio.ogg&#39;</span>
@ -130,7 +136,7 @@ can be played by a simple <a class="reference internal" href="../reference.html#
<span class="n">dec</span> <span class="o">=</span> <span class="n">decode</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
</pre></div>
</div>
<p>We are almost there. Now, lets look at the document for <a class="reference internal" href="../reference.html#palace.Decoder.play" title="palace.Decoder.play"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Decoder.play()</span></code></a>.
<p>We are almost there. Now, lets look at the document for <a class="reference internal" href="../reference/decoder.html#palace.Decoder.play" title="palace.Decoder.play"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Decoder.play()</span></code></a>.
The method takes 3 parameters: <code class="docutils literal notranslate"><span class="pre">chunk_len</span></code>, <code class="docutils literal notranslate"><span class="pre">queue_size</span></code>, and <code class="docutils literal notranslate"><span class="pre">source</span></code>.</p>
<p>The source object is optional, because if you dont have it, a new source
will be generated by default.</p>
@ -147,7 +153,7 @@ Then <code class="docutils literal notranslate"><span class="pre">queue_size</sp
</div>
<p>But we dont want it to play only a small part of the audio. We want it to
play all of it. How do we do that? The answer is a loop.</p>
<p>There is a method, <a class="reference internal" href="../reference.html#palace.Context.update" title="palace.Context.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Context.update()</span></code></a>, which update the context and the source.
<p>There is a method, <a class="reference internal" href="../reference/context.html#palace.Context.update" title="palace.Context.update"><code class="xref py py-meth docutils literal notranslate"><span class="pre">Context.update()</span></code></a>, which update the context and the source.
When the source is updated, it will be filled with new chunks of data from
the decoder.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">palace</span> <span class="kn">import</span> <span class="n">Device</span><span class="p">,</span> <span class="n">Context</span><span class="p">,</span> <span class="n">Source</span><span class="p">,</span> <span class="n">decode</span>
@ -192,7 +198,7 @@ is to <code class="docutils literal notranslate"><span class="pre">sleep</span><
<a href="context.html" title="Previous document">Context Creation</a>
</li>
<li>
<a href="../reference.html" title="Next document">Reference</a>
<a href="../reference/index.html" title="Next document">Reference</a>
&rarr;
</li>
</ul>

View File

@ -22,4 +22,10 @@
GitHub Repository
</a>
</li>
<li class="toctree-l1">
<a class="reference external"
href="https://matrix.to/#/#palace-dev:matrix.org">
Matrix Chat Room
</a>
</li>
</ul>

View File

@ -33,7 +33,6 @@ release = '0.2.0'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
napoleon_google_docstring = False
napoleon_use_ivar = True
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

View File

@ -130,7 +130,7 @@ to improve the CI/CD may find it helpful.
Play around with it for a little to make sure that everything is OK.
#. Under the local repository, checkout the ``gh-pages`` branch.
Often, is it necessary to update the credits under the :doc:`copying`
section and review if the :doc:`reference` section needs any change
section and review if the :doc:`reference/index` section needs any change
before running ``make html`` to rebuild to documentation.
#. View the documentation locally then push it to GitHub.

View File

@ -9,6 +9,7 @@ to fix or remove the issue.
License
-------
Palace is free software: you can redistribute it and/or modify it
under the terms of the `GNU Lesser General Public License`_
as published by the Free Software Foundation, either version 3

View File

@ -1,6 +1,8 @@
Design Principles
=================
.. currentmodule:: palace
In this section, we will discuss a few design principles in order to write
a safe, efficient, easy-to-use and extendable 3D audio library for Python,
by wrapping existing functionalities from the C++ API alure_.
@ -128,7 +130,7 @@ as it is equivalent to
Other than closure/destruction of objects, typical uses of `context managers`__
also include saving and restoring various kinds of global state (as seen in
:py:class:`palace.Context`), locking and unlocking resources, etc.
:py:class:`Context`), locking and unlocking resources, etc.
__ https://docs.python.org/3/reference/datamodel.html#context-managers
@ -173,7 +175,7 @@ from ``BaseDecoder`` will be exposed to C++ as an attribute of ``CppDecoder``.
Effectively, this means the users can have the alure API calling their
inherited Python object as naturally as if palace is implemented in pure Python.
In practice, :py:class:`palace.BaseDecoder` will also need to take into account
In practice, :py:class:`BaseDecoder` will also need to take into account
other guarding mechanisms like :py:class:`abc.ABC`. Due to Cython limitations,
implementation as a pure Python class and :ref:`aliasing <getter-setter>` of
``@getter``/``@setter`` should be considered.

View File

@ -1,29 +1,38 @@
Welcome to our palace!
======================
Overview
========
Pythonic Audio Library and Codecs Environment provides common higher-level API
for audio rendering using OpenAL. It wraps around the C++ interface alure_
for 3D positional rendering, environmental effects and out-of-the-box
codec support, while using Cython to provide a modern interface with
type hinting, data descriptors, context managers and ``snake_case``
for a safe, convenient and pleasurable experience.
for audio rendering using OpenAL:
* 3D positional rendering, with HRTF_ support for stereo systems
* Environmental effects: reverb, atmospheric air absorption,
sound occlusion and obstruction
* Out-of-the-box codec support:
Palace wraps around the C++ interface alure_ using Cython_ for a safe and
convenient interface with type hinting, data descriptors and context managers,
following :pep:`8#naming-conventions` (``PascalCase.snake_case``).
Table of Contents
-----------------
.. toctree::
:maxdepth: 2
installation
tutorial/index
reference
reference/index
design
contributing
copying
Indices and tables
==================
Indices and Tables
------------------
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. _HRTF: https://en.wikipedia.org/wiki/Head-related_transfer_function
.. _alure: https://github.com/kcat/alure
.. _Cython: https://cython.org

View File

@ -1,178 +0,0 @@
Reference
=========
.. currentmodule:: palace
Audio Devices
-------------
.. data:: device_names
:type: DeviceNames
Read-only namespace of device names by category (``basic``, ``full`` and
``capture``), as tuples of strings whose first item being the default.
.. autofunction:: query_extension
.. autoclass:: Device
:members:
Audio Library Contexts
----------------------
.. data:: CHANNEL_CONFIG
:type: int
Context creation key to specify the channel configuration
(either ``MONO``, ``STEREO``, ``QUAD``, ``X51``, ``X61`` or ``X71``).
.. data:: SAMPLE_TYPE
:type: int
Context creation key to specify the sample type
(either ``[UNSIGNED_]{BYTE,SHORT,INT}`` or ``FLOAT``).
.. data:: FREQUENCY
:type: int
Context creation key to specify the frequency in hertz.
.. data:: MONO_SOURCES
:type: int
Context creation key to specify the number of mono (3D) sources.
.. data:: STEREO_SOURCES
:type: int
Context creation key to specify the number of stereo sources.
.. data:: MAX_AUXILIARY_SENDS
:type: int
Context creation key to specify the maximum number of
auxiliary source sends.
.. data:: HRTF
:type: int
Context creation key to specify whether to enable HRTF
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: HRTF_ID
:type: int
Context creation key to specify the HRTF to be used.
.. data:: OUTPUT_LIMITER
:type: int
Context creation key to specify whether to use a gain limiter
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: distance_models
:type: Tuple[str, ...]
Names of available distance models.
.. autofunction:: thread_local
.. autofunction:: current_context
.. autofunction:: use_context
.. autoclass:: Context
:members:
.. autoclass:: Listener
:members:
.. autoclass:: MessageHandler
:members:
Resource Caching
----------------
.. autofunction:: cache
.. autofunction:: free
.. autoclass:: Buffer
:members:
Sources & Source Groups
-----------------------
.. autoclass:: Source
:members:
.. autoclass:: SourceGroup
:members:
Environmental Effects
---------------------
For the sake of brevity, we only document the constraints of each effect's
properties. Further details can be found at OpenAL's `Effect Extension Guide`_
which specifies the purpose and usage of each value.
.. data:: reverb_preset_names
:type: Tuple[str, ...]
Names of predefined reverb effect presets in lexicographical order.
.. autoclass:: BaseEffect
:members:
.. autoclass:: ReverbEffect
:members:
.. autoclass:: ChorusEffect
:members:
Decoder Interface
-----------------
.. data:: sample_types
:type: Tuple[str, ...]
Names of available sample types.
.. data:: channel_configs
:type: Tuple[str, ...]
Names of available channel configurations.
.. data:: decoder_factories
:type: DecoderNamespace
Simple object for storing decoder factories.
User-registered factories are tried one after another
if :py:exc:`RuntimeError` is raised, in lexicographical order.
Internal decoder factories are always used after registered ones.
.. autofunction:: decode
.. autofunction:: sample_size
.. autofunction:: sample_length
.. autoclass:: Decoder
:members:
.. autoclass:: BaseDecoder
:members:
File I/O Interface
------------------
.. autofunction:: current_fileio
.. autofunction:: use_fileio
.. autoclass:: FileIO
:members:
.. _Effect Extension Guide:
https://kcat.strangesoft.net/misc-downloads/Effects%20Extension%20Guide.pdf

17
src/reference/buffer.rst Normal file
View File

@ -0,0 +1,17 @@
Resource Caching
================
.. currentmodule:: palace
Audio Buffers
-------------
.. autoclass:: Buffer
:members:
Loading & Freeing in Batch
--------------------------
.. autofunction:: cache
.. autofunction:: free

83
src/reference/context.rst Normal file
View File

@ -0,0 +1,83 @@
Audio Library Contexts
======================
.. currentmodule:: palace
Context and Auxiliary Classes
-----------------------------
.. autoclass:: Context
:members:
.. autoclass:: Listener
:members:
.. autoclass:: MessageHandler
:members:
Using Contexts
--------------
.. autofunction:: use_context
.. autofunction:: current_context
.. autofunction:: thread_local
Context Creation Attributes
---------------------------
.. data:: CHANNEL_CONFIG
:type: int
Context creation key to specify the channel configuration
(either ``MONO``, ``STEREO``, ``QUAD``, ``X51``, ``X61`` or ``X71``).
.. data:: SAMPLE_TYPE
:type: int
Context creation key to specify the sample type
(either ``[UNSIGNED_]{BYTE,SHORT,INT}`` or ``FLOAT``).
.. data:: FREQUENCY
:type: int
Context creation key to specify the frequency in hertz.
.. data:: MONO_SOURCES
:type: int
Context creation key to specify the number of mono (3D) sources.
.. data:: STEREO_SOURCES
:type: int
Context creation key to specify the number of stereo sources.
.. data:: MAX_AUXILIARY_SENDS
:type: int
Context creation key to specify the maximum number of
auxiliary source sends.
.. data:: HRTF
:type: int
Context creation key to specify whether to enable HRTF
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: HRTF_ID
:type: int
Context creation key to specify the HRTF to be used.
.. data:: OUTPUT_LIMITER
:type: int
Context creation key to specify whether to use a gain limiter
(either ``FALSE``, ``TRUE`` or ``DONT_CARE``).
.. data:: distance_models
:type: Tuple[str, ...]
Names of available distance models.

44
src/reference/decoder.rst Normal file
View File

@ -0,0 +1,44 @@
Audio Streams
=============
.. currentmodule:: palace
Builtin Decoders
----------------
.. autoclass:: Decoder
:members:
Decoder Interface
-----------------
.. data:: decoder_factories
:type: DecoderNamespace
Simple object for storing decoder factories.
User-registered factories are tried one after another
if :py:exc:`RuntimeError` is raised, in lexicographical order.
Internal decoder factories are always used after registered ones.
.. autofunction:: decode
.. autoclass:: BaseDecoder
:members:
Miscellaneous
-------------
.. data:: sample_types
:type: Tuple[str, ...]
Names of available sample types.
.. data:: channel_configs
:type: Tuple[str, ...]
Names of available channel configurations.
.. autofunction:: sample_size
.. autofunction:: sample_length

21
src/reference/device.rst Normal file
View File

@ -0,0 +1,21 @@
Audio Devices
=============
.. currentmodule:: palace
Device-Dependent Utilities
--------------------------
.. autoclass:: Device
:members:
Device-Independent Utilities
----------------------------
.. data:: device_names
:type: DeviceNames
Read-only namespace of device names by category (``basic``, ``full`` and
``capture``), as tuples of strings whose first item being the default.
.. autofunction:: query_extension

34
src/reference/effect.rst Normal file
View File

@ -0,0 +1,34 @@
Environmental Effects
=====================
.. currentmodule:: palace
For the sake of brevity, we only document the constraints of each effect's
properties. Further details can be found at OpenAL's `Effect Extension Guide`_
which specifies the purpose and usage of each value.
Base Effect
-----------
.. autoclass:: BaseEffect
:members:
Chorus Effect
-------------
.. autoclass:: ChorusEffect
:members:
Reverb Effect
-------------
.. data:: reverb_preset_names
:type: Tuple[str, ...]
Names of predefined reverb effect presets in lexicographical order.
.. autoclass:: ReverbEffect
:members:
.. _Effect Extension Guide:
https://kcat.strangesoft.net/misc-downloads/Effects%20Extension%20Guide.pdf

11
src/reference/file-io.rst Normal file
View File

@ -0,0 +1,11 @@
File I/O Interface
==================
.. currentmodule:: palace
.. autofunction:: current_fileio
.. autofunction:: use_fileio
.. autoclass:: FileIO
:members:

14
src/reference/index.rst Normal file
View File

@ -0,0 +1,14 @@
Reference
=========
API reference is divided into the following sections:
.. toctree::
device
context
buffer
source
effect
decoder
file-io

16
src/reference/source.rst Normal file
View File

@ -0,0 +1,16 @@
Sources & Source Groups
=======================
.. currentmodule:: palace
Sources
-------
.. autoclass:: Source
:members:
Source Groups
-------------
.. autoclass:: SourceGroup
:members:

View File

@ -1,8 +1,8 @@
.. py:currentmodule:: palace
Context Creation
================
.. currentmodule:: palace
A context is an object that allows palace to access OpenAL,
which is essential when you work with palace. Context maintains
the audio environment and contains environment settings and components

View File

@ -1,8 +1,8 @@
.. py:currentmodule:: palace
Play an Audio
=============
.. currentmodule:: palace
Now that you know how to create a context,
let's get into the most essential use case: playing audio.