<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">Vector3</code><aclass="headerlink"href="#palace.Vector3"title="Permalink to this definition">¶</a></dt>
<dd><p>Tuple of three floats.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>Type</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.CHANNEL_CONFIG">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">CHANNEL_CONFIG</code><aclass="headerlink"href="#palace.CHANNEL_CONFIG"title="Permalink to this definition">¶</a></dt>
<dd><p>Context creation key to specify the channel configuration
(either <cite>MONO</cite>, <cite>STEREO</cite>, <cite>QUAD</cite>, <cite>X51</cite>, <cite>X61</cite> or <cite>X71</cite>).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.SAMPLE_TYPE">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">SAMPLE_TYPE</code><aclass="headerlink"href="#palace.SAMPLE_TYPE"title="Permalink to this definition">¶</a></dt>
<dd><p>Context creation key to specify the sample type
(either <cite>[UNSIGNED_]{BYTE,SHORT,INT}</cite> or <cite>FLOAT</cite>).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.FREQUENCY">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">FREQUENCY</code><aclass="headerlink"href="#palace.FREQUENCY"title="Permalink to this definition">¶</a></dt>
<dd><p>Context creation key to specify the frequency in hertz.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.MONO_SOURCES">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">MONO_SOURCES</code><aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.STEREO_SOURCES">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">STEREO_SOURCES</code><aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.MAX_AUXILIARY_SENDS">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">MAX_AUXILIARY_SENDS</code><aclass="headerlink"href="#palace.MAX_AUXILIARY_SENDS"title="Permalink to this definition">¶</a></dt>
<dd><p>Context creation key to specify the maximum number of
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">HRTF</code><aclass="headerlink"href="#palace.HRTF"title="Permalink to this definition">¶</a></dt>
<dd><p>Context creation key to specify whether to enable HRTF
(either <cite>FALSE</cite>, <cite>TRUE</cite> or <cite>DONT_CARE</cite>).</p>
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">HRTF_ID</code><aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.OUTPUT_LIMITER">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">OUTPUT_LIMITER</code><aclass="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 <cite>FALSE</cite>, <cite>TRUE</cite> or <cite>DONT_CARE</cite>).</p>
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">sample_types</code><aclass="headerlink"href="#palace.sample_types"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">channel_configs</code><aclass="headerlink"href="#palace.channel_configs"title="Permalink to this definition">¶</a></dt>
<dd><p>Names of available channel configurations.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>Tuple[str, ..]</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.device_names">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">device_names</code><aclass="headerlink"href="#palace.device_names"title="Permalink to this definition">¶</a></dt>
<dd><p>Read-only namespace of device names by category (basic, full and
capture), as tuples of strings whose first item being the default.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Type</dt>
<ddclass="field-odd"><p>DeviceNames</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.decoder_factories">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">decoder_factories</code><aclass="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 <cite>RuntimeError</cite> is raised, in lexicographical order.
Internal decoder factories are always used after registered ones.</p>
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">sample_size</code><spanclass="sig-paren">(</span><emclass="sig-param">length: int</em>, <emclass="sig-param">str channel_config: str</em>, <emclass="sig-param">str sample_type: str</em><spanclass="sig-paren">)</span>→ int<aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><strong>RuntimeError</strong>– If the byte size result too large.</p>
</dd>
</dl>
</dd></dl>
<dlclass="function">
<dtid="palace.sample_length">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">sample_length</code><spanclass="sig-paren">(</span><emclass="sig-param">size: int</em>, <emclass="sig-param">str channel_config: str</em>, <emclass="sig-param">str sample_type: str</em><spanclass="sig-paren">)</span>→ int<aclass="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>
</dd></dl>
<dlclass="function">
<dtid="palace.query_extension">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">query_extension</code><spanclass="sig-paren">(</span><emclass="sig-param">str name: str</em><spanclass="sig-paren">)</span>→ bool<aclass="headerlink"href="#palace.query_extension"title="Permalink to this definition">¶</a></dt>
<dd><p>Return if a non-device-specific ALC extension exists.</p>
<divclass="admonition seealso">
<pclass="admonition-title">See also</p>
<dlclass="simple">
<dt><aclass="reference internal"href="#palace.Device.query_extension"title="palace.Device.query_extension"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">Device.query_extension()</span></code></a></dt><dd><p>Query ALC extension on a device</p>
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">current_context</code><spanclass="sig-paren">(</span><emclass="sig-param">thread: bool = False</em><spanclass="sig-paren">)</span>→ Optional[Context]<aclass="headerlink"href="#palace.current_context"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">current_fileio</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ Optional[Callable[[str], FileIO]]<aclass="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>
<dlclass="function">
<dtid="palace.use_fileio">
<codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">use_fileio</code><spanclass="sig-paren">(</span><emclass="sig-param">factory: Optional[Callable[[str], FileIO]], buffer_size: int = DEFAULT_BUFFER_SIZE</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<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>
<emclass="property">property </em><codeclass="sig-name descname">alc_version</code><aclass="headerlink"href="#palace.Device.alc_version"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">basic_name</code><aclass="headerlink"href="#palace.Device.basic_name"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">clock_time</code><aclass="headerlink"href="#palace.Device.clock_time"title="Permalink to this definition">¶</a></dt>
<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 device’s real clock.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Device.close">
<codeclass="sig-name descname">close</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<emclass="property">property </em><codeclass="sig-name descname">current_hrtf</code><aclass="headerlink"href="#palace.Device.current_hrtf"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">efx_version</code><aclass="headerlink"href="#palace.Device.efx_version"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">frequency</code><aclass="headerlink"href="#palace.Device.frequency"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">hrtf_enabled</code><aclass="headerlink"href="#palace.Device.hrtf_enabled"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">hrtf_names</code><aclass="headerlink"href="#palace.Device.hrtf_names"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">max_auxiliary_sends</code><aclass="headerlink"href="#palace.Device.max_auxiliary_sends"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">name</code><aclass="headerlink"href="#palace.Device.name"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">pause_dsp</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<dlclass="method">
<dtid="palace.Device.query_extension">
<codeclass="sig-name descname">query_extension</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">str name: str</em><spanclass="sig-paren">)</span>→ bool<aclass="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>
<codeclass="sig-name descname">reset</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">attrs: Dict[int</em>, <emclass="sig-param">int] = {}</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<dlclass="method">
<dtid="palace.Device.resume_dsp">
<codeclass="sig-name descname">resume_dsp</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<dlclass="class">
<dtid="palace.Context">
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">Context</code><spanclass="sig-paren">(</span><emclass="sig-param">Device device: Device</em>, <emclass="sig-param">attrs: Dict[int</em>, <emclass="sig-param">int] = {}</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Context"title="Permalink to this definition">¶</a></dt>
<dd><p>Container maintaining the entire audio environment, its settings
and components such as sources, buffers and effects.</p>
<p>This can be used as a context manager, e.g.</p>
<li><p><strong>device</strong> (<aclass="reference internal"href="#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>
<dlclass="attribute">
<dtid="palace.Context.device">
<codeclass="sig-name descname">device</code><aclass="headerlink"href="#palace.Context.device"title="Permalink to this definition">¶</a></dt>
<dd><p>The device this context was created from.</p>
<codeclass="sig-name descname">async_wake_interval</code><aclass="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>
<dlclass="method">
<dtid="palace.Context.available_resamplers">
<emclass="property">property </em><codeclass="sig-name descname">available_resamplers</code><aclass="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>
</dd></dl>
<dlclass="method">
<dtid="palace.Context.default_resampler_index">
<emclass="property">property </em><codeclass="sig-name descname">default_resampler_index</code><aclass="headerlink"href="#palace.Context.default_resampler_index"title="Permalink to this definition">¶</a></dt>
<dd><p>The context’s 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
<codeclass="sig-name descname">destroy</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<emclass="property">property </em><codeclass="sig-name descname">doppler_factor</code><aclass="headerlink"href="#palace.Context.doppler_factor"title="Permalink to this definition">¶</a></dt>
<dd><p>Factor to apply to all source’s doppler calculations.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Context.end_batch">
<codeclass="sig-name descname">end_batch</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Context.end_batch"title="Permalink to this definition">¶</a></dt>
<dd><p>Continue processing the context and end batching.</p>
<codeclass="sig-name descname">message_handler</code><aclass="headerlink"href="#palace.Context.message_handler"title="Permalink to this definition">¶</a></dt>
<dd><p>Handler of some certain events.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Context.speed_of_sound">
<emclass="property">property </em><codeclass="sig-name descname">speed_of_sound</code><aclass="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>
<dlclass="method">
<dtid="palace.Context.start_batch">
<codeclass="sig-name descname">start_batch</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Context.start_batch"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">update</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="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><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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>context</strong> (<aclass="reference internal"href="#palace.Context"title="palace.Context"><em>Context</em></a>) – The context from which the buffer is to be created and cached.</p></li>
<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>
</ul>
</dd>
</dl>
<dlclass="attribute">
<dtid="palace.Buffer.name">
<codeclass="sig-name descname">name</code><aclass="headerlink"href="#palace.Buffer.name"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">channel_config</code><aclass="headerlink"href="#palace.Buffer.channel_config"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">destroy</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Buffer.destroy"title="Permalink to this definition">¶</a></dt>
<dd><p>Free the buffer’s cache</p>
<p>This invalidates all other <cite>Buffer</cite> objects with the same name.</p>
<emclass="property">property </em><codeclass="sig-name descname">frequency</code><aclass="headerlink"href="#palace.Buffer.frequency"title="Permalink to this definition">¶</a></dt>
<emclass="property">static </em><codeclass="sig-name descname">from_decoder</code><spanclass="sig-paren">(</span><emclass="sig-param">Decoder decoder: Decoder</em>, <emclass="sig-param">Context context: Context</em>, <emclass="sig-param">str name: str</em><spanclass="sig-paren">)</span>→ Buffer<aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>decoder</strong> (<aclass="reference internal"href="#palace.Decoder"title="palace.Decoder"><em>Decoder</em></a>) – The decoder from which the buffer is to be cached.</p></li>
<li><p><strong>context</strong> (<aclass="reference internal"href="#palace.Context"title="palace.Context"><em>Context</em></a>) – The context from which the buffer is to be created.</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>
</ul>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>RuntimeError</strong>– If the buffer cannot be created.</p>
<emclass="property">property </em><codeclass="sig-name descname">length</code><aclass="headerlink"href="#palace.Buffer.length"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">length_seconds</code><aclass="headerlink"href="#palace.Buffer.length_seconds"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">loop_points</code><aclass="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 < end <= length</cite>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="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>
<pclass="rubric">Notes</p>
<p>The buffer must not be in use when this property is set.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Buffer.play">
<codeclass="sig-name descname">play</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">source: Optional[Source] = None</em><spanclass="sig-paren">)</span>→ Source<aclass="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>
<emclass="property">property </em><codeclass="sig-name descname">sample_type</code><aclass="headerlink"href="#palace.Buffer.sample_type"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">size</code><aclass="headerlink"href="#palace.Buffer.size"title="Permalink to this definition">¶</a></dt>
<dd><p>Storage size used by the buffer, in bytes.</p>
<pclass="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>
<emclass="property">property </em><codeclass="sig-name descname">source_count</code><aclass="headerlink"href="#palace.Buffer.source_count"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">sources</code><aclass="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>
<dlclass="class">
<dtid="palace.Source">
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">Source</code><spanclass="sig-paren">(</span><emclass="sig-param">Context context: Context</em><spanclass="sig-paren">)</span>→ None<aclass="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 source’s
destructioni upon completion of the block, even if an error occurs.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>context</strong> (<aclass="reference internal"href="#palace.Context"title="palace.Context"><em>Context</em></a>) – The context from which the source is to be created.</p>
</dd>
</dl>
<dlclass="attribute">
<dtid="palace.Source.air_absorption_factor">
<codeclass="sig-name descname">air_absorption_factor</code><aclass="headerlink"href="#palace.Source.air_absorption_factor"title="Permalink to this definition">¶</a></dt>
<dd><p>Multiplier for the amount of atmospheric high-frequency
absorption, 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>
<dlclass="method">
<dtid="palace.Source.auxiliary_send">
<emclass="property">property </em><codeclass="sig-name descname">auxiliary_send</code><aclass="headerlink"href="#palace.Source.auxiliary_send"title="Permalink to this definition">¶</a></dt>
<dd><p>Connect the effect slot to the given send path.</p>
<p>Any filter properties on the send path remain as they were.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.cone_angles">
<codeclass="sig-name descname">cone_angles</code><aclass="headerlink"href="#palace.Source.cone_angles"title="Permalink to this definition">¶</a></dt>
<dd><p>Cone inner and outer angles in degrees.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="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>
<dtclass="field-even">Raises</dt>
<ddclass="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>
<pclass="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>
<dlclass="method">
<dtid="palace.Source.destroy">
<codeclass="sig-name descname">destroy</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<dlclass="attribute">
<dtid="palace.Source.distance_range">
<codeclass="sig-name descname">distance_range</code><aclass="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 source’s calculated
distance is clamped to the specified range before applying
distance-related attenuation.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>refdist</strong> (<em>float</em>) – The distance at which the source’s 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>
<dtclass="field-even">Raises</dt>
<ddclass="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>
<dlclass="attribute">
<dtid="palace.Source.doppler_factor">
<codeclass="sig-name descname">doppler_factor</code><aclass="headerlink"href="#palace.Source.doppler_factor"title="Permalink to this definition">¶</a></dt>
<dd><p>The doppler factor for the doppler effect’s pitch shift.</p>
<p>This effectively scales the source and listener velocities
for the doppler calculation.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><strong>ValueError</strong>– If set to a value outside of the [0, 1] interval.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="palace.Source.fade_out_to_stop">
<codeclass="sig-name descname">fade_out_to_stop</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">double gain: float</em>, <emclass="sig-param">ms: int</em><spanclass="sig-paren">)</span>→ None<aclass="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>Pending playback from a future buffer is not immediately
canceled, but the fade timer starts with this call. If the
future buffer then becomes ready, it will start mid-fade.
Pending playback will be canceled if the fade out completes
before the future buffer becomes ready.</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>
<dlclass="attribute">
<dtid="palace.Source.gain">
<codeclass="sig-name descname">gain</code><aclass="headerlink"href="#palace.Source.gain"title="Permalink to this definition">¶</a></dt>
<dd><p>Base linear volume gain, default to 1.0.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><strong>ValueError</strong>– If set to a negative value.</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.gain_auto">
<codeclass="sig-name descname">gain_auto</code><aclass="headerlink"href="#palace.Source.gain_auto"title="Permalink to this definition">¶</a></dt>
<dd><p>Whether the direct path’s 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>
<dlclass="attribute">
<dtid="palace.Source.gain_range">
<codeclass="sig-name descname">gain_range</code><aclass="headerlink"href="#palace.Source.gain_range"title="Permalink to this definition">¶</a></dt>
<dd><p>The range which the source’s gain is clamped to after
distance and cone attenuation are applied to the gain base,
although before the filter gain adjustements.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="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>
<dtclass="field-even">Raises</dt>
<ddclass="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>
<dlclass="attribute">
<dtid="palace.Source.group">
<codeclass="sig-name descname">group</code><aclass="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>
<divclass="admonition seealso">
<pclass="admonition-title">See also</p>
<dlclass="simple">
<dt><aclass="reference internal"href="#palace.SourceGroup"title="palace.SourceGroup"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">SourceGroup</span></code></a></dt><dd><p>A group of <cite>Source</cite> references</p>
<emclass="property">property </em><codeclass="sig-name descname">latency</code><aclass="headerlink"href="#palace.Source.latency"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">latency_seconds</code><aclass="headerlink"href="#palace.Source.latency_seconds"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">offset_seconds</code><aclass="headerlink"href="#palace.Source.offset_seconds"title="Permalink to this definition">¶</a></dt>
<p>Unlike the <cite>AL_EXT_BFORMAT</cite> extension this property
comes from, this also affects the facing direction.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.outer_cone_gains">
<codeclass="sig-name descname">outer_cone_gains</code><aclass="headerlink"href="#palace.Source.outer_cone_gains"title="Permalink to this definition">¶</a></dt>
<dd><p>Linear gain and gainhf multiplier when the listener is
outside of the source’s outer cone area.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>gain</strong> (<em>float</em>) – Linear gain applying to all frequencies, default to 1.</p></li>
<li><p><strong>gainhf</strong> (<em>float</em>) – Linear gainhf 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>
<dtclass="field-even">Raises</dt>
<ddclass="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>
<dlclass="method">
<dtid="palace.Source.pause">
<codeclass="sig-name descname">pause</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Source.pause"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">paused</code><aclass="headerlink"href="#palace.Source.paused"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">pending</code><aclass="headerlink"href="#palace.Source.pending"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">playing</code><aclass="headerlink"href="#palace.Source.playing"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">playing_or_pending</code><aclass="headerlink"href="#palace.Source.playing_or_pending"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">position</code><aclass="headerlink"href="#palace.Source.position"title="Permalink to this definition">¶</a></dt>
<dd><p>3D position of the source.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.priority">
<codeclass="sig-name descname">priority</code><aclass="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>
<dlclass="attribute">
<dtid="palace.Source.radius">
<codeclass="sig-name descname">radius</code><aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><strong>ValueError</strong>– If set to a negative value.</p>
</dd>
</dl>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.relative">
<codeclass="sig-name descname">relative</code><aclass="headerlink"href="#palace.Source.relative"title="Permalink to this definition">¶</a></dt>
<dd><p>Whether the source’s position, velocity, and orientation
are relative to the listener.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.resampler_index">
<codeclass="sig-name descname">resampler_index</code><aclass="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>
<dlclass="method">
<dtid="palace.Source.resume">
<codeclass="sig-name descname">resume</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Source.resume"title="Permalink to this definition">¶</a></dt>
<dd><p>Resume the source if it is paused.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.rolloff_factors">
<codeclass="sig-name descname">rolloff_factors</code><aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Raises</dt>
<ddclass="field-odd"><p><strong>ValueError</strong>– If either of rolloff factors is set to a negative value.</p>
</dd>
</dl>
<pclass="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>
<dlclass="attribute">
<dtid="palace.Source.spatialize">
<codeclass="sig-name descname">spatialize</code><aclass="headerlink"href="#palace.Source.spatialize"title="Permalink to this definition">¶</a></dt>
<dd><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>
<dlclass="attribute">
<dtid="palace.Source.stereo_angles">
<codeclass="sig-name descname">stereo_angles</code><aclass="headerlink"href="#palace.Source.stereo_angles"title="Permalink to this definition">¶</a></dt>
<dd><p>Left and right channel angles, in radians, when playing
a stereo buffer or stream. The angles go counter-clockwise,
with 0 being in front and positive values going left.</p>
<p>This has no effect without the <cite>AL_EXT_STEREO_ANGLES</cite> extension.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Source.stop">
<codeclass="sig-name descname">stop</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Source.stop"title="Permalink to this definition">¶</a></dt>
<dd><p>Stop playback, releasing the buffer or decoder reference.</p>
<p>Any pending playback from a future buffer is canceled.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.Source.velocity">
<codeclass="sig-name descname">velocity</code><aclass="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 source’s
position, and instead just alters the pitch as determined
by the doppler effect.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="palace.SourceGroup">
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">SourceGroup</code><spanclass="sig-paren">(</span><emclass="sig-param">Context context: Context</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>context</strong> (<aclass="reference internal"href="#palace.Context"title="palace.Context"><em>Context</em></a>) – The context from which the source group is to be created.</p>
</dd>
</dl>
<dlclass="method">
<dtid="palace.SourceGroup.destroy">
<codeclass="sig-name descname">destroy</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.SourceGroup.destroy"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">gain</code><aclass="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>
<dlclass="attribute">
<dtid="palace.SourceGroup.parent_group">
<codeclass="sig-name descname">parent_group</code><aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Raises</dt>
<ddclass="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>
<dlclass="method">
<dtid="palace.SourceGroup.pause_all">
<codeclass="sig-name descname">pause_all</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.SourceGroup.pause_all"title="Permalink to this definition">¶</a></dt>
<dd><p>Pause all currently-playing sources that are under
this group, including sub-groups.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.SourceGroup.pitch">
<codeclass="sig-name descname">pitch</code><aclass="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>
<dlclass="method">
<dtid="palace.SourceGroup.resume_all">
<codeclass="sig-name descname">resume_all</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.SourceGroup.resume_all"title="Permalink to this definition">¶</a></dt>
<dd><p>Resume all paused sources that are under this group,
<emclass="property">property </em><codeclass="sig-name descname">sources</code><aclass="headerlink"href="#palace.SourceGroup.sources"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">stop_all</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.SourceGroup.stop_all"title="Permalink to this definition">¶</a></dt>
<dd><p>Stop all sources that are under this group,
<emclass="property">property </em><codeclass="sig-name descname">sub_groups</code><aclass="headerlink"href="#palace.SourceGroup.sub_groups"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">AuxiliaryEffectSlot</code><spanclass="sig-paren">(</span><emclass="sig-param">Context context: Context</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.AuxiliaryEffectSlot"title="Permalink to this definition">¶</a></dt>
<dd><p>An effect processor.</p>
<p>It takes the output mix of zero or more sources,
applies DSP for the desired effect (as configured
by a given <cite>Effect</cite> object), 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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>context</strong> (<aclass="reference internal"href="#palace.Context"title="palace.Context"><em>Context</em></a>) – The context to create the auxiliary effect slot.</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>RuntimeError</strong>– If the effect slot can’t be created.</p>
</dd>
</dl>
<dlclass="method">
<dtid="palace.AuxiliaryEffectSlot.destroy">
<codeclass="sig-name descname">destroy</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.AuxiliaryEffectSlot.destroy"title="Permalink to this definition">¶</a></dt>
<dd><p>Destroy the effect slot, returning it to the system.
If the effect slot is currently set on a source send,
<emclass="property">property </em><codeclass="sig-name descname">effect</code><aclass="headerlink"href="#palace.AuxiliaryEffectSlot.effect"title="Permalink to this definition">¶</a></dt>
<dd><p>Effect to be held by the slot.</p>
<p>The given effect object may be altered or destroyed without
<emclass="property">property </em><codeclass="sig-name descname">gain</code><aclass="headerlink"href="#palace.AuxiliaryEffectSlot.gain"title="Permalink to this definition">¶</a></dt>
<dd><p>Gain of the effect slot.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.AuxiliaryEffectSlot.send_auto">
<emclass="property">property </em><codeclass="sig-name descname">send_auto</code><aclass="headerlink"href="#palace.AuxiliaryEffectSlot.send_auto"title="Permalink to this definition">¶</a></dt>
<dd><p>If set to <cite>True</cite>, the reverb effect will automatically
apply adjustments to the source’s send slot gains based
on the effect properties.</p>
<p>Has no effect when using non-reverb effects. Default is <cite>True</cite>.</p>
<emclass="property">property </em><codeclass="sig-name descname">source_sends</code><aclass="headerlink"href="#palace.AuxiliaryEffectSlot.source_sends"title="Permalink to this definition">¶</a></dt>
<dd><p>List of each <cite>Source</cite> object and its pairing
<emclass="property">property </em><codeclass="sig-name descname">use_count</code><aclass="headerlink"href="#palace.AuxiliaryEffectSlot.use_count"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">Effect</code><spanclass="sig-paren">(</span><emclass="sig-param">Context context: Context</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Effect"title="Permalink to this definition">¶</a></dt>
<dd><p>A collection of settings or parameters.</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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>context</strong> (<aclass="reference internal"href="#palace.Context"title="palace.Context"><em>Context</em></a>) – The context from which the effect is to be created.</p>
</dd>
</dl>
<dlclass="method">
<dtid="palace.Effect.chorus_properties">
<emclass="property">property </em><codeclass="sig-name descname">chorus_properties</code><aclass="headerlink"href="#palace.Effect.chorus_properties"title="Permalink to this definition">¶</a></dt>
<dd><p>The effect with the specified chorus properties.</p>
<p>It will be thrown if EAXReverb effect is not supported.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Effect.destroy">
<codeclass="sig-name descname">destroy</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Effect.destroy"title="Permalink to this definition">¶</a></dt>
<dd><p>Destroy the effect.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Effect.reverb_properties">
<emclass="property">property </em><codeclass="sig-name descname">reverb_properties</code><aclass="headerlink"href="#palace.Effect.reverb_properties"title="Permalink to this definition">¶</a></dt>
<dd><p>The effect with the specified reverb properties.</p>
<p>It will automatically downgrade to the Standard Reverb effect
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">Decoder</code><spanclass="sig-paren">(</span><emclass="sig-param">Context context: Context</em>, <emclass="sig-param">str name: str</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#palace.Decoder"title="Permalink to this definition">¶</a></dt>
<dd><p>Generic audio decoder.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>context</strong> (<aclass="reference internal"href="#palace.Context"title="palace.Context"><em>Context</em></a>) – The context from which the decoder is to be created.</p></li>
<li><p><strong>name</strong> (<em>str</em>) – Audio file or resource name.</p></li>
<emclass="property">property </em><codeclass="sig-name descname">channel_config</code><aclass="headerlink"href="#palace.Decoder.channel_config"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">frequency</code><aclass="headerlink"href="#palace.Decoder.frequency"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">length</code><aclass="headerlink"href="#palace.Decoder.length"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">length_seconds</code><aclass="headerlink"href="#palace.Decoder.length_seconds"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">loop_points</code><aclass="headerlink"href="#palace.Decoder.loop_points"title="Permalink to this definition">¶</a></dt>
<p>If <cite>start >= end</cite>, all available samples are included
in the loop.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.Decoder.play">
<codeclass="sig-name descname">play</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">Source source: Source</em>, <emclass="sig-param">chunk_len: int</em>, <emclass="sig-param">queue_size: int</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>source</strong> (<aclass="reference internal"href="#palace.Source"title="palace.Source"><em>Source</em></a>) – The source object to play audio.</p></li>
<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>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="palace.Decoder.read">
<codeclass="sig-name descname">read</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">count: int</em><spanclass="sig-paren">)</span>→ bytes<aclass="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>
<divclass="admonition seealso">
<pclass="admonition-title">See also</p>
<dlclass="simple">
<dt><aclass="reference internal"href="#palace.sample_length"title="palace.sample_length"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">sample_length()</span></code></a></dt><dd><p>length of samples of given size</p>
<emclass="property">property </em><codeclass="sig-name descname">sample_type</code><aclass="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>
<dlclass="method">
<dtid="palace.Decoder.seek">
<codeclass="sig-name descname">seek</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">pos: int</em><spanclass="sig-paren">)</span>→ bool<aclass="headerlink"href="#palace.Decoder.seek"title="Permalink to this definition">¶</a></dt>
<dd><p>Seek to pos, specified in sample frames.</p>
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">BaseDecoder</code><aclass="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>
<dlclass="method">
<dtid="palace.BaseDecoder.channel_config">
<emclass="property">abstract property </em><codeclass="sig-name descname">channel_config</code><aclass="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>
<dlclass="method">
<dtid="palace.BaseDecoder.frequency">
<emclass="property">abstract property </em><codeclass="sig-name descname">frequency</code><aclass="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>
<dlclass="method">
<dtid="palace.BaseDecoder.length">
<emclass="property">abstract property </em><codeclass="sig-name descname">length</code><aclass="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>
<pclass="rubric">Notes</p>
<p>Zero-length decoders may not be used to load a <cite>Buffer</cite>.</p>
</dd></dl>
<dlclass="method">
<dtid="palace.BaseDecoder.loop_points">
<emclass="property">abstract property </em><codeclass="sig-name descname">loop_points</code><aclass="headerlink"href="#palace.BaseDecoder.loop_points"title="Permalink to this definition">¶</a></dt>
<p>If <cite>start >= end</cite>, all available samples are included
in the loop.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.BaseDecoder.read">
<codeclass="sig-name descname">read</code><aclass="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>
<dlclass="method">
<dtid="palace.BaseDecoder.sample_type">
<emclass="property">abstract property </em><codeclass="sig-name descname">sample_type</code><aclass="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>
<dlclass="attribute">
<dtid="palace.BaseDecoder.seek">
<codeclass="sig-name descname">seek</code><aclass="headerlink"href="#palace.BaseDecoder.seek"title="Permalink to this definition">¶</a></dt>
<dd><p>Seek to pos, specified in sample frames.</p>
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">FileIO</code><aclass="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>
<pclass="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>
<dlclass="attribute">
<dtid="palace.FileIO.close">
<codeclass="sig-name descname">close</code><aclass="headerlink"href="#palace.FileIO.close"title="Permalink to this definition">¶</a></dt>
<dd><p>Close the file.</p>
</dd></dl>
<dlclass="attribute">
<dtid="palace.FileIO.read">
<codeclass="sig-name descname">read</code><aclass="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>
<dlclass="attribute">
<dtid="palace.FileIO.seek">
<codeclass="sig-name descname">seek</code><aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="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),
<emclass="property">class </em><codeclass="sig-prename descclassname">palace.</code><codeclass="sig-name descname">MessageHandler</code><aclass="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>
<dlclass="method">
<dtid="palace.MessageHandler.buffer_loading">
<codeclass="sig-name descname">buffer_loading</code><spanclass="sig-paren">(</span><emclass="sig-param">self, str name: str, str channel_config: str, str sample_type: str, sample_rate: int, data: List[int]</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="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>List</em><em>[</em><em>int</em><em>]</em>) – The audio data that is about to be fed to the OpenAL buffer.</p></li>
<codeclass="sig-name descname">device_disconnected</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">Device device: Device</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<pclass="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>
<dlclass="method">
<dtid="palace.MessageHandler.resource_not_found">
<codeclass="sig-name descname">resource_not_found</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">str name: str</em><spanclass="sig-paren">)</span>→ str<aclass="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
<codeclass="sig-name descname">source_force_stopped</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">Source source: Source</em><spanclass="sig-paren">)</span>→ None<aclass="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>
<ulclass="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 that’s getting removed.</p></li>
</ul>
</dd></dl>
<dlclass="method">
<dtid="palace.MessageHandler.source_stopped">
<codeclass="sig-name descname">source_stopped</code><spanclass="sig-paren">(</span><emclass="sig-param">self</em>, <emclass="sig-param">Source source: Source</em><spanclass="sig-paren">)</span>→ None<aclass="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>