MLAudioOutput
NameSpace: MagicLeap
Manages Audio.
Inherits from:
MLAutoAPISingleton< MLAudioOutput >,
MLLazySingleton< T >
Public Fields
AudioOutputDevice
Gets the audio output device.
public static Device AudioOutputDevice { get; set; }
Type | Description |
---|---|
Device | The currently active output device. |
MasterVolume
Gets the master volume for the device.
public static float MasterVolume { get; set; }
Public Methods
MLResult GetSoundBypassesMasterVolume
public static MLResult GetSoundBypassesMasterVolume(
out bool isBypassing
)
Parameters
Type | Name | Description |
---|---|---|
out bool | isBypassing |
delegate void MLAudioMediaEventDelegate
The delegate for audio output media event.
public delegate void MLAudioMediaEventDelegate(
MediaEvent mediaEvent
)
Parameters
Type | Name | Description |
---|---|---|
MediaEvent | device | The new media event. |
delegate void OnAudioOutputDeviceChangedDelegate
The delegate for audio output device changed event.
public delegate void OnAudioOutputDeviceChangedDelegate(
Device device
)
Parameters
Type | Name | Description |
---|---|---|
Device | device | The new audio output device. |
delegate void OnMasterVolumeChangedDelegate
The delegate for the master volume changed event.
public delegate void OnMasterVolumeChangedDelegate(
float volume
)
Parameters
Type | Name | Description |
---|---|---|
float | volume | The new master volume value. |
MLResult SetSoundBypassesMasterVolume
public static MLResult SetSoundBypassesMasterVolume(
bool isBypassing
)
Parameters
Type | Name | Description |
---|---|---|
bool | isBypassing |
Protected Methods
StopAPI
Called by MLAutoAPISingleton on destruction
protected virtual override MLResult.Code StopAPI()
Parameters
Type | Name | Description |
---|---|---|
isSafeToAccessManagedObjects | Not Implemented |
Reimplements: StopAPI
Update
Called every device frame
protected virtual override void Update()
Reimplements: Update
Public Events
OnAudioOutputDeviceChanged
Raised whenever the audio output device gets changed.
public static OnAudioOutputDeviceChangedDelegate OnAudioOutputDeviceChanged()
OnMasterVolumeChanged
Raised whenever the master volume gets changed.
public static OnMasterVolumeChangedDelegate OnMasterVolumeChanged()
OnMediaEvent
Raised whenever the media event happens.
public static MLAudioMediaEventDelegate OnMediaEvent()
Public Enums
ChannelFormatType
Possible channel formats for input and output streams.
Enumerator | Value | Description |
---|---|---|
Default | ||
AmbisonicAmbix |
ChannelLayouts
Definition of some of the known Channel Layouts. These layouts are based on ChannelMask composite of individual channel masks.
Enumerator | Value | Description |
---|---|---|
None | ChannelMask.None | |
Mono | ChannelMask.FrontLeft | Mask shortcut for Mono audio output. |
Stereo | ChannelMask.FrontLeft | ChannelMask.FrontRight |
StereoFrontCenter | Stereo | ChannelMask.FrontCenter |
Quad | ChannelMask.FrontLeft | ChannelMask.FrontRight |
ChannelMask.BackLeft | ChannelMask.BackRight | Mask shortcut for Quad audio output. |
QuadFrontCenter | Quad | ChannelMask.FrontCenter |
Surround | ChannelMask.FrontLeft | ChannelMask.FrontRight |
ChannelMask.BackCenter | Mask shortcut for surround audio output. | |
FivePointOne | ChannelMask.FrontLeft | ChannelMask.FrontRight |
ChannelMask.BackLeft | ChannelMask.BackRight | |
ChannelMask.LowFrequencyEffects | Mask shortcut for 5.1 audio output. | |
FivePointOneBackCenter | FivePointOne | ChannelMask.BackCenter |
SevenPointOne | FivePointOne | ChannelMask.FrontLeftOfCenter |
SevenPointOneSurround | FivePointOne | ChannelMask.SideLeft |
ChannelMask
Audio output channels mask for track type. Bits order matches the C API. These masks are an ORed composite of individual channel masks. For example MLAudioOutput.ChannelLayout.Stereo is composed of MLAudioOutput.ChannelMask.FrontLeft and MLAudioOutput.ChannelMask.FrontRight. Reference:
Enumerator | Value | Description |
---|---|---|
None | 0 | |
FrontLeft | 0x1 | |
FrontRight | 0x2 | |
FrontCenter | 0x4 | |
LowFrequencyEffects | 0x8 | |
BackLeft | 0x10 | |
BackRight | 0x20 | |
FrontLeftOfCenter | 0x40 | |
FrontRightOfCenter | 0x80 | |
BackCenter | 0x100 | |
SideLeft | 0x200 | |
SideRight | 0x400 | |
TopCenter | 0x800 | |
TopFrontLeft | 0x1000 | |
TopFrontCenter | 0x2000 | |
TopFrontRight | 0x4000 | |
TopBackLeft | 0x8000 | |
TopBackCenter | 0x10000 | |
TopBackRight | 0x20000 |
Details*
* https://android.googlesource.com/platform/frameworks/base/+/b267554/media/java/android/media/AudioFormat.java * https://trac.ffmpeg.org/wiki/AudioChannelManipulation#Listchannelnamesandstandardchannellayouts
Device
The currently active output device.
Enumerator | Value | Description |
---|---|---|
Wearable | Built-in speakers in the wearable. | |
AnalogJack | 3.5mm jack on the belt pack. |
MediaEvent
Possible media control events initiated by the user.
Enumerator | Value | Description |
---|---|---|
Play | Indicates a user command to play | |
Stop | Indicates a user command to stop. | |
Pause | Indicates a user command to pause. | |
NextTrack | Indicates a user command to go to next track. | |
PrevTrack | Indicates a user command to go to previous track. |
SampleFormatType
Possible sample formats for input and output streams.
Enumerator | Value | Description |
---|---|---|
Int | ||
Float |