Urho.Audio.Audio Class

Audio subsystem, used to playback both regular audio and 3D sound.

See Also: Audio

Syntax

public class Audio : UrhoObject

Remarks

The Audio class represents the audio subsystem, which implements an audio output stream. It is the hub for audio operations in your application.  See the Urho.Audio documentation for more information.

To hear pseudo-3D positional sounds, a SoundListener component must exist in a scene node and be assigned to the audio subsystem by setting the Audio.Listener property. 

The output is software mixed for an unlimited amount of simultaneous sounds. Ogg Vorbis sounds are decoded on the fly, and decoding them can be memory- and CPU-intensive, so WAV files are recommended when a large number of short sound effects need to be played.

For purposes of volume control, each SoundSource can be classified into a user defined group which is multiplied with a master category and the individual SoundSource gain set using SoundSource.Gain for the final volume level.

To control the category volumes, set the Audio.SetMasterGain, which defines the category if it didn't already exist.

It is possible to control the playback of a class of sounds identified by their type by using the Audio.PauseSoundTypeAudio.ResumeSoundType and Audio.ResumeAll methods.  You can probe whether a specific sound type is paused by calling the Audio.IsSoundTypePaused.   The list of possible sound types are the strings “Master”, “Effect”, “Ambient”, “Voice” and “Music”.

Requirements

Namespace: Urho.Audio
Assembly: Urho (in Urho.dll)
Assembly Versions: 1.0.0.0

The members of Urho.Audio.Audio are listed below.

See Also: UrhoObject

Public Constructors

Constructs a new instance of Urho.Audio.Audio which is tied to the Application.CurrentContext.
Constructs a new instance of Urho.Audio.Audio, given a raw pointer to an unmanaged object
Constructs a new instance of Urho.Audio.Audio linked to a specific Context.

Protected Constructors

Empty constructor, chain to this constructor when you provide your own constructor that sets the handle field.

Public Properties

[read-only]
InitializedBoolean. Return whether an audio stream has been reserved.
[read-only]
InterpolationBoolean. Return whether output is interpolated.
ListenerSoundListener. Return active sound listener. Or Set active sound listener for 3D sounds.
[read-only]
MixRateInt32. Return mixing rate.
[read-only]
PlayingBoolean. Return whether audio is being output.
[read-only]
SampleSizeUInt32. Return byte size of one sample.
[read-only]
StereoBoolean. Determines whether output is stereo.
[read-only]
override
TypeStringHash. Urho's type system type.
[read-only]
override
TypeNameString. Urho's low-level type name.
[read-only]
static
TypeNameStaticString. Urho's low-level type name, accessible as a static method.
[read-only]
static
TypeStaticStringHash. Urho's low-level type, accessible as a static method.

Public Methods

AddSoundSource(SoundSource)
Add a sound source to keep track of. Called by SoundSource.
GetMasterGain(String) : Single
Return master gain for a specific sound source type. Unknown sound types will return full gain (1).
GetSoundSourceMasterGain(StringHash) : Single
Return sound type specific gain multiplied by master gain.
HasMasterGain(String) : Boolean
Return whether the specified master gain has been defined.
IsSoundTypePaused(String) : Boolean
Returns whether the specified sound type is currently paused.
MixOutput(IntPtr, UInt32)
Mix sound sources into the buffer.
PauseSoundType(String)
Pause playing back the sounds of the specific type.
Play() : Boolean
Restart sound output.
RemoveSoundSource(SoundSource)
Remove a sound source. Called by SoundSource.
ResumeAll()
Resumes playback of all sound types.
ResumeSoundType(String)
Resumes playing back the sounds of the specific type.
SetMasterGain(String, Single)
Set master gain on a specific sound type such as sound effects, music or voice.
SetMode(Int32, Int32, Boolean, Boolean) : Boolean
Initialize sound output with specified buffer length and output mode.
Stop()
Suspend sound output.
StopSound(Sound)
Stop any sound source playing a certain sound clip.
Update(Single)