Audio Playback and Capture
This module provides a cross platform API to decode sound files, capture audio, and play audio. There is support for 3D Spatialization. You can adjust the listener's or sound's position, direction, and velocity. The positions are absolute values in the 3D space.
Decodes .wav data into a Sound handle.
Decodes a .wav file into a Sound handle. File path can be absolute or relative to the cwd.
Decodes .mp3 data into a Sound handle.
Decodes a .mp3 file into a Sound handle. File path can be absolute or relative to the cwd.
Decodes .flac data into a Sound handle.
Decodes a .flac file into a Sound handle. File path can be absolute or relative to the cwd.
Decodes .ogg data into a Sound handle.
Decodes a .ogg file into a Sound handle. File path can be absolute or relative to the cwd.
Attempt to decode wav, mp3, flac, or ogg data into a Sound handle.
Attempt to decode wav, mp3, flac, or ogg file into a Sound handle. File path can be absolute or relative to the cwd.
Sets the listener's position in 3D space.
Returns the listener's position in 3D space.
Sets the listener's forward direction in 3D space. See also setListenerUpDir.
Returns the listener's forward direction in 3D space.
Sets the listener's up direction in 3D space.
Returns the listener's up direction in 3D space.
Sets the listener's velocity in 3D space. This is for the doppler effect.
Returns the listener's velocity in 3D space.
Plays the sound. This won't return until the sound is done playing.
Starts playing the sound in the background. Returns immediately. Playing the sound while it's already playing will rewind to the start and begin playback.
Returns whether the sound is playing or looping in the background.
Starts looping the sound in the background.
Returns whether the sound is looping in the background.
Pauses the playback.
Resumes the playback from the current cursor position. If the cursor is at the end, it will rewind to the start and begin playback.
Stops the playback and rewinds to the start.
Sets the volume in a positive linear scale. Volume at 0 is muted. 1 is the default value.
Returns the volume in a positive linear scale.
Sets the volume with gain in decibels.
Gets the gain in decibels.
Sets the pitch. A higher value results in a higher pitch and must be greater than 0. Default value is 1.
Returns the current pitch.
Sets the stereo pan. Default value is 0. Set to -1 to shift the sound to the left and +1 to shift the sound to the right.
Returns the current stereo pan.
Returns the length of the sound in pcm frames. Unsupported for ogg.
Returns the length of the sound in milliseconds. Unsupported for ogg.
Returns the current playback position in pcm frames. Unsupported for ogg.
Seeks to playback position in pcm frames.
Sets the sound's position in 3D space.
Returns the sound's position in 3D space.
Sets the sound's direction in 3D space.
Returns the sound's direction in 3D space.
Sets the sound's velocity in 3D space. This is for the doppler effect.
Returns the sound's velocity in 3D space.