Expand description
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
extern crate steam_audio;

use steam_audio::ffi;

use std::mem;

fn main() {
    let mut context: ffi::IPLhandle = unsafe { mem::zeroed() };

    use ffi::IPLerror::*;

    match unsafe { ffi::iplCreateContext(None, None, None, &mut context) } {
        IPL_STATUS_SUCCESS => eprintln!("Successfully created context"),
        err @ _ => panic!("Error creating context ({:?})", err),
    }

    unsafe {
        ffi::iplDestroyContext(&mut context);
    }
}

Structs

An air absorption model that can be used for modeling frequency-dependent attenuation of sound over distance.

Parameters for applying an Ambisonics binaural effect to an audio buffer.

Settings used to create an Ambisonics binaural effect.

Parameters for applying an Ambisonics decode effect to an audio buffer.

Settings used to create an Ambisonics decode effect.

Parameters for applying an Ambisonics encode effect to an audio buffer.

Settings used to create an Ambisonics encode effect.

Parameters for applying an Ambisonics panning effect to an audio buffer.

Settings used to create an Ambisonics panning effect.

Parameters for applying an Ambisonics rotation effect to an audio buffer.

Settings used to create an Ambisonics rotation effect.

Describes an audio buffer. All audio buffers passed to Steam Audio must be deinterleaved.

Global settings for audio signal processing.

Identifies a “layer” of data stored in a probe batch. Each probe batch may store multiple layers of data, such as reverb, static source reflections, or pathing. Each layer can be accessed using an identifier.

Parameters for applying a binaural effect to an audio buffer.

Settings used to create a binaural effect.

An axis-aligned box. Axis-aligned boxes are used to specify a volume of 3D space.

Settings used to create a context object.

A 3D coordinate system, expressed relative to a canonical coordinate system.

Flags indicating which direct path parameters to apply.

Parameters for applying a direct effect to an audio buffer.

Settings used to create a direct effect.

Flags indicating which types of direct simulation should be enabled for a given \c IPLSource.

A directivity pattern that can be used to model changes in sound intensity as a function of the source’s orientation. Can be used with both direct and indirect sound propagation.

A distance attenuation model that can be used for modeling attenuation of sound over distance. Can be used with both direct and indirect sound propagation.

Settings used to create an HRTF object.

Information about a ray’s intersection with 3D geometry.

Settings used to create an instanced mesh.

The acoustic properties of a surface.

A 4x4 matrix used to represent an affine transform.

Describes the properties of an OpenCL device. This information can be used to select the most suitable device for your application.

Specifies requirements that an OpenCL device must meet in order to be considered when listing OpenCL devices.

Parameters for applying a panning effect to an audio buffer.

Settings used to create a panning effect.

Parameters used to control how pathing data is baked.

Parameters for applying a path effect to an audio buffer.

Settings used to create a path effect.

Settings used to generate probes.

A ray in 3D space.

Parameters for applying a reflection effect to an audio buffer.

Settings used to create a reflection effect.

Flags for specifying what types of reflections data to bake.

Parameters used to control how reflections data is baked.

Settings used to create a scene.

Settings used to create a serialized object.

Flags indicating which types of simulation should be enabled for a given \c IPLSource.

Simulation parameters for a source.

Simulation results for a source.

Settings used to create a simulator.

Simulation parameters that are not specific to any source.

Settings used to create a source.

Describes a standard or custom speaker layout.

A sphere. Spheres are used to define a region of influence around a point.

Settings used to create a static mesh.

A triangle in 3D space.

Settings used to create a TrueAudio Next device.

A point or vector in 3D space. Steam Audio uses a right-handed coordinate system, with the positive x-axis pointing right, the positive y-axis pointing up, and the negative z-axis pointing ahead. Position and direction data obtained from a game engine or audio engine must be properly transformed before being passed to any Steam Audio API function.

Parameters for applying a virtual surround effect to an audio buffer.

Settings used to create a virtual surround effect.

Enums

The types of air absorption that can be used.

Supported channel ordering and normalization schemes for Ambisonic audio.

States that an audio effect can be left in after processing a frame of audio.

The types of baked data that can be stored in a probe batch.

The different ways in which the source and listener positions used to generate baked data can vary as a function of probe position.

The types of distance attenuation that can be used.

Techniques for interpolating HRTF data. This is used when rendering a point source whose position relative to the listener is not contained in the measured HRTF data.

The type of HRTF to use.

Severity levels of log messages generated by Steam Audio.

The different algorithms for simulating occlusion.

The type of devices to include when listing OpenCL devices.

The different algorithms for generating probes.

Type of reflection effect algorithm to use.

SIMD instruction sets that Steam Audio can attempt to use.

The types of scenes that can be created. Each scene type corresponds to a different ray tracing implementation.

Supported speaker layouts.

Modes of applying transmission effects.

Boolean values.

Status codes returned by Steam Audio API functions.

Constants

Functions

Calculates the air absorption coefficients between a source and a listener.

Applies an Ambisonics binaural effect to an audio buffer.

Creates an Ambisonics binaural effect.

Releases a reference to an Ambisonics binaural effect.

Resets the internal processing state of an Ambisonics binaural effect.

Retains an additional reference to an Ambisonics binaural effect.

Applies an Ambisonics decode effect to an audio buffer.

Creates an Ambisonics rotation effect.

Releases a reference to an Ambisonics rotation effect.

Resets the internal processing state of an Ambisonics rotation effect.

Retains an additional reference to an Ambisonics rotation effect.

Applies an Ambisonics encode effect to an audio buffer.

Creates an Ambisonics encode effect.

Releases a reference to an Ambisonics encode effect.

Resets the internal processing state of an Ambisonics encode effect.

Retains an additional reference to an Ambisonics encode effect.

Applies an Ambisonics panning effect to an audio buffer.

Creates an Ambisonics panning effect.

Releases a reference to an Ambisonics panning effect.

Resets the internal processing state of an Ambisonics panning effect.

Retains an additional reference to an Ambisonics panning effect.

Applies an Ambisonics rotation effect to an audio buffer.

Creates an Ambisonics rotation effect.

Releases a reference to an Ambisonics rotation effect.

Resets the internal processing state of an Ambisonics rotation effect.

Retains an additional reference to an Ambisonics rotation effect.

Allocates an audio buffer.

Converts an Ambisonic audio buffer from one Ambisonic format to another.

Writes interleaved samples from a user-provided array into an audio buffer.

Downmixes a multi-channel audio buffer into a mono audio buffer.

Frees an audio buffer.

Reads samples from an audio buffer and interleaves them into a user-provided array.

Mixes one audio buffer into another.

Applies a binaural effect to an audio buffer.

Creates a binaural effect.

Releases a reference to a binaural effect.

Resets the internal processing state of a binaural effect.

Retains an additional reference to a binaural effect.

Calculates the relative direction from the listener to a sound source. The returned direction vector is expressed in the listener’s coordinate system.

Creates a context object. A context must be created before creating any other API objects.

Releases a reference to a context. The context will not be destroyed until all references are released.

Retains an additional reference to a context. The context will not be destroyed until all references are released.

Applies a direct effect to an audio buffer.

Creates a direct effect.

Releases a reference to a direct effect.

Resets the internal processing state of a direct effect.

Retains an additional reference to a direct effect.

Calculates the attenuation of a source due to its directivity pattern and orientation relative to a listener.

Calculates the distance attenuation between a source and a listener.

Creates an Embree device.

Releases a reference to an Embree device.

Retains an additional reference to an Embree device.

Creates an HRTF.

Releases a reference to an HRTF object.

Retains an additional reference to an HRTF object.

Adds an instanced mesh to a scene.

Creates an instanced mesh.

Releases a reference to a instanced mesh.

Removes an instanced mesh from a scene.

Retains an additional reference to a instanced mesh.

Updates the local-to-world transform of an instanced mesh within its parent scene.

Creates an OpenCL device. The device is specified as an index into an OpenCL device list.

Creates an OpenCL device from an existing OpenCL device created by your application. Steam Audio will use up to two command queues that you provide for enqueuing OpenCL computations.

Creates an OpenCL device list. This involves listing all available OpenCL devices on the user’s system.

Retrieves information about a specific device in an OpenCL device list.

\return The number of devices in an OpenCL device list.

Releases a reference to an OpenCL device list.

Retains an additional reference to an OpenCL device list.

Releases a reference to an OpenCL device.

Retains an additional reference to an OpenCL device.

Applies a panning effect to an audio buffer.

Creates a panning effect.

Releases a reference to a panning effect.

Resets the internal processing state of a panning effect.

Retains an additional reference to a panning effect.

Bakes a single layer of pathing data in a probe batch.

Cancels any running bakes of pathing data.

Applies a path effect to an audio buffer.

Creates a path effect.

Releases a reference to a path effect.

Resets the internal processing state of a path effect.

Retains an additional reference to a path effect.

Creates an empty probe array.

Generates probes and adds them to a probe array.

\return The number of probes in a probe array.

\return The probe at a given index in a probe array.

Releases a reference to a probe array.

Retains an additional reference to a probe array.

Adds a probe to a batch. The new probe will be added as the last probe in the batch.

Adds every probe in an array to a batch. The new probes will be added, in order, at the end of the batch.

Commits all changes made to a probe batch since this function was last called (or since the probe batch was first created, if this function was never called). This function must be called after adding, removing, or updating any probes in the batch, for the changes to take effect.

Creates an empty probe batch.

\return The size (in bytes) of a specific baked data layer in a probe batch.

\return The number of probes in a probe batch.

Loads a probe batch from a serialized object. Typically, the serialized object will be created from a byte array loaded from disk or over the network.

Releases a reference to a probe batch.

Deletes a specific layer of data from a probe batch.

Removes a probe from a batch.

Retains an additional reference to a probe batch.

Saves a probe batch to a serialized object. Typically, the serialized object will then be saved to disk.

Creates a Radeon Rays device.

Releases a reference to a Radeon Rays device.

Retains an additional reference to a Radeon Rays device.

Applies a reflection effect to an audio buffer.

Creates a reflection effect.

Releases a reference to a reflection effect.

Resets the internal processing state of a reflection effect.

Retains an additional reference to a reflection effect.

Retrieves the contents of a reflection mixer and places it into an audio buffer.

Creates a reflection effect mixer.

Releases a reference to a reflection mixer.

Resets the internal processing state of a reflection mixer.

Retains an additional reference to a reflection mixer.

Bakes a single layer of reflections data in a probe batch.

Cancels any running bakes of reflections data.

Commits any changes to the scene.

Creates a scene.

Loads a scene from a serialized object. Typically, the serialized object will be created from a byte array loaded from disk or over the network.

Releases a reference to a scene.

Retains an additional reference to a scene.

Saves a scene to a serialized object. Typically, the serialized object will then be saved to disk.

Saves a scene to an OBJ file.

Creates a serialized object.

\return A pointer to a byte array of serialized data contained in a serialized object.

\return The size in bytes of the serialized data contained in a serialized object.

Releases a reference to a serialized object.

Retains an additional reference to a serialized object.

Adds a probe batch for use in subsequent simulations. Sources that require baked data can then use the data contained in the specified probe batch.

Commits changes to the scene or probe batches used for simulation.

Creates a simulator.

Releases a reference to a simulator.

Removed a probe batch from use in subsequent simulations. Sources that require baked data will then stop using the data contained in the specified probe batch.

Retains an additional reference to a simulator.

Runs a direct simulation for all sources added to the simulator. This may include distance attenuation, air absorption, directivity, occlusion, and transmission.

Runs a pathing simulation for all sources added to the simulator.

Runs a reflections simulation for all sources added to the simulator.

Specifies the scene within which all subsequent simulations should be run.

Specifies simulation parameters that are not associated with any particular source.

Adds a source to the set of sources processed by a simulator in subsequent simulations.

Creates a simulation source.

Retrieves simulation results for a source.

Releases a reference to a source.

Removes a source from the set of sources processed by a simulator in subsequent simulations.

Retains an additional reference to a source.

Specifies simulation parameters for a source.

Adds a static mesh to a scene.

Creates a static mesh.

Loads a static mesh from a serialized object. Typically, the serialized object will be created from a byte array loaded from disk or over the network.

Releases a reference to a static mesh.

Removes a static mesh from a scene.

Retains an additional reference to a static mesh.

Saves a static mesh to a serialized object. Typically, the serialized object will then be saved to disk.

Creates a TrueAudio Next device.

Releases a reference to a TrueAudio Next device.

Retains an additional reference to a TrueAudio Next device.

Applies a virtual surround effect to an audio buffer.

Creates a virtual surround effect.

Releases a reference to a virtual surround effect.

Resets the internal processing state of a virtual surround effect.

Retains an additional reference to a virtual surround effect.

Type Definitions

Callback for calculating how much air absorption should be applied to a sound based on its distance from the listener.

Prototype of a callback that allocates memory. This is usually specified to let Steam Audio use a custom memory allocator. The default behavior is to use the OS-dependent aligned version of \c malloc.

Callback for calculating whether a ray hits any geometry.

Callback for calculating for each ray in a batch of rays, whether the ray hits any geometry.

Callback for calculating the closest hit along a batch of rays.

Callback for calculating the closest hit along a ray.

Callback for calculating how much to attenuate a sound based on its directivity pattern and orientation in world space.

Callback for calculating how much attenuation should be applied to a sound based on its distance from the listener.

Prototype of a callback that frees a block of memory. This is usually specified when using a custom memory allocator with Steam Audio. The default behavior is to use the OS-dependent aligned version of \c free.

Prototype of a callback that logs a message generated by Steam Audio. This may be implemented in any suitable way, such as appending to a log file, displaying a dialog box, etc. The default behavior is to print to \c stdout.

Callback for updating the application on the progress of a function.

\defgroup types Data Types Common data types used throughout the Steam Audio API. {