Skip to content
Robert Campbell edited this page Oct 14, 2022 · 1 revision

Subsystem Overview

Ultraviolet’s Audio subsystem is exposed through the IUltravioletAudio interface, which you can retrieve an instance of by calling UltravioletContext.GetAudio(). This interface allows you to change the state of the current audio playback device.

Check out the reference documentation for a complete run-down what what the IUltravioletAudio interface is capable of. Here’s a brief overview of some of the important points.

You can enumerate the system's audio devices using the EnumerateAudioDevices() method and select the one to use for audio playback using the PlaybackDevice property.

You can suspend and resume all audio playback using the Suspend() and Resume() methods.

You can modify global volume settings using the AudioMasterVolume, SongsMasterVolume, and SoundEffectsMasterVolume properties.

You can globally mute and unmute sounds using the AudioMuted, SongsMuted, and SoundEffectsMuted properties.

Associated Resources

This list is not exhaustive, but should be enough to get you started. Check out the reference documentation for more information.

The Song class represents streaming audio intended for use as background music. You can access basic information about the song, such as its name, duration, and metadata tags, using the the class' instance methods and properties. You can play Song instances using the SongPlayer class.

The SoundEffect class represents short audio samples intended for use as sound effects. You can play SoundEffect instances in a "fire-and-forget" fashion using the class' instance methods, or you can manage their playback more precisely using the SoundEffectPlayer class.

Clone this wiki locally