type alias Audio.Type Aliases | [src] |
BusHandle | BusHandle | |
VoiceHandle | VoiceHandle |
struct Audio.Bus | [src] |
Represents a bus.
handle | BusHandle |
A Voice can be assigned to one or more buses. If you then change some parameters of the bus (like the volume), then all the voices assigned to it will be impacted.
create | Creates an audio bus. |
destroy | Destroy the bus (immediatly). |
getVolume | Returns the actual volume. |
getVolumeDB | Returns the actual volume, in DB. |
setVolume | Set the playing bus volume between [0..1]. |
setVolumeDB | Set the playing bus volume in DB. |
func Bus.create | [src] |
Creates an audio bus.
You can then associate a Voice to that bus with Voice.setRooting Note that you can have a graph of buses, because a bus can have another bus as parent.
func Bus.destroy | [src] |
Destroy the bus (immediatly).
func Bus.getVolume | [src] |
Returns the actual volume.
func Bus.getVolumeDB | [src] |
Returns the actual volume, in DB.
func Bus.setVolume | [src] |
Set the playing bus volume between [0..1].
func Bus.setVolumeDB | [src] |
Set the playing bus volume in DB.
struct Audio.Codec | [src] |
Base struct for all codec instances.
srcEncoding | SoundFileEncoding | The original encoding. |
dstEncoding | SoundFileEncoding | The requested encoding. |
type | const *Swag.TypeInfoStruct | The real type of the codec. |
interface Audio.ICodec | [src] |
Interface to describe a codec.
canEncode | func(*ICodec, SoundFileEncoding)->bool | |
canDecode | func(*ICodec, SoundFileEncoding)->bool | |
init | func(*ICodec, ^void, u64)->u64 throw | |
decode | func(*ICodec, ^void, u64, ^void, u64)->{write:u64,read:u64} throw |
struct Audio.SoundFile | [src] |
Represents a sound file.
fullname | Core.String | |
datas | Core.Array'(u8) | Prefetched datas (in encoding format). |
sampleCount | u64 | Total number of samples. |
dataSize | u64 | Total size, in bytes, of datas. |
dataSeek | u64 | The position in the file where the datas are stored. |
encoding | SoundFileEncoding | Encoding type of the datas. |
validity | SoundFileValidityMask | What informations in this struct are valid. |
frequency | u32 | Sound frequency. |
channelCount | u32 | Number of channels (2 for stereo...). |
channelMask | u32 | Identifier of the channels. |
bitsPerSample | u32 | Number of bits per sample in the datas. |
duration | f32 | Duration, in seconds, of the sound. |
validBitsPerSample | u16 | Number of valid bits per sample (<= bitsPerSample). |
The SoundFile is not necessary fully loaded in memory, in case we want it to be streamed.
load | Load a SoundFile from disk. |
func SoundFile.load | [src] |
Load a SoundFile from disk.
Will load the sound datas if loadDatas is true. Will load the sound metadatas if loadMetaData is true.
enum Audio.SoundFileEncoding | [src] |
SoundFile internal format.
Unknown | |
Pcm8 | Pcm, uncompressed, 8 bits per sample. |
Pcm16 | Pcm, uncompressed, 16 bits per sample. |
Pcm24 | Pcm, uncompressed, 24 bits per sample. |
Pcm32 | Pcm, uncompressed, 32 bits per sample. |
Float32 | Pcm, uncompressed, float 32 bits per sample. |
enum Audio.SoundFileValidityMask | [src] |
Determins which informations in the SoundFile struct are valid.
Zero | |
Format | |
Frequency | |
ChannelCount | |
ChannelMask | |
BitsPerSample | |
Duration | |
SampleCount | |
ValidBitsPerSample | |
Data | |
MetaData |
struct Audio.Voice | [src] |
Represents a playing sound.
create | Creates a new voice for a given sound file. |
destroy | Destroy the voice. |
getVolume | Returns the actual volume. |
getVolumeDB | Returns the actual volume, in DB. |
isPlaying | Returns true if the voice is currently playing. |
pause | Pause the playing voice. |
play(*SoundFile, VoiceCreateFlags, VoicePlayFlags) | Creates a voice and plays it. |
play(self, VoicePlayFlags) | Plays a voice. |
setFrequencyRatio | Set the playing pitch. |
setRooting | Root a voice to a given list of buses. |
setVolume | Set the playing voice volume between [0..1]. |
setVolumeDB | Set the playing voice volume. |
stop | Stop the playing voice. |
opDrop |
func Voice.create | [src] |
Creates a new voice for a given sound file.
A voice is what will be actually played. You can have as many voices as you want for one unique SoundFile.
func Voice.destroy | [src] |
Destroy the voice.
func Voice.getVolume | [src] |
Returns the actual volume.
func Voice.getVolumeDB | [src] |
Returns the actual volume, in DB.
func Voice.isPlaying | [src] |
Returns true if the voice is currently playing.
func Voice.opDrop | [src] |
func Voice.pause | [src] |
Pause the playing voice.
func Voice.play | [src] |
Creates a voice and plays it.
By default, the voice will be destroyed when stopped or finished.
Plays a voice.
By default, you will have to destroy the voice yourself when no more needed, for example if Voice.isPlaying returns false. But if you want the voice to be destroyed automatically when done, set the DestroyOnStop flag in playFlags. See Voice.create
func Voice.setFrequencyRatio | [src] |
Set the playing pitch.
The voice should have been created with VoiceCreateFlags.AcceptPitch. See Voice.create
func Voice.setRooting | [src] |
Root a voice to a given list of buses.
You can also set buses to null if you want to root the voice only to the main bus (which is the default).
func Voice.setVolume | [src] |
Set the playing voice volume between [0..1].
func Voice.setVolumeDB | [src] |
Set the playing voice volume.
func Voice.stop | [src] |
Stop the playing voice.
enum Audio.VoiceCreateFlags | [src] |
Zero | |
AcceptPitch | |
AcceptFilters | |
Default |
enum Audio.VoicePlayFlags | [src] |
Zero | |
Loop | Play in loops. |
DestroyOnStop | Destroy the voice once the sound has been played. |
Default |
enum Audio.VoiceState | [src] |
Zero | |
PlayedOnce | |
Playing | |
PendingDestroy |
namespace Audio.Wav |
loadFile | Load a wav file. |
func Wav.loadFile | [src] |
Load a wav file.
func Audio.addCodec | [src] |
Register a codec.
func Audio.convertDBToPercent | [src] |
Convert a DB value to a percent.
func Audio.convertPercentToDB | [src] |
Convert a percent value to DB.
func Audio.createEngine | [src] |
Creates the audio engine.
Must be called once, before anything else.
func Audio.destroyEngine | [src] |
Destroy the audio engine.
Must be called at the end, when engine is no more used.
func Audio.getOutputVolume | [src] |
Get the general output volume.
func Audio.setOutputVolume | [src] |
Set the general output volume.