Class MediaDecoder
Odin Playback Media
Implements:
OdinNative.Wrapper.Media.IMedia, System.IDisposable
Properties
Id
Media id
IsPaused
Samplerate
Output samplerate
Stereo
Output channel flag
IsAlive
Flag if the native decoder handle is still usable, e.g. false after the peer left and the decoder was disposed
Pipeline
Odin effect pipeline
ChannelMask
Position
ListenChannelMask
Channels this decoder accepts incoming datagrams for when routed by OdinNative.Wrapper.Room.Room.Room_OnDatagram(System.Object,OdinNative.Wrapper.Room.DatagramEventArgs) .
Defaults to OdinNative.Core.Utility.ChannelMask.All so a single decoder receives every channel of its peer.
Parent
Default value null indicates root or not set
Methods
Create(uint, bool)
Create a new dangling output media.
Returns
OdinNative.Wrapper.MediaDecoder: output media
Parameters
| Type | Name | Description |
|---|---|---|
System.UInt32 | samplerate | samplerate |
System.Boolean | stereo | stereo flag |
GetPipeline()
Get native effect pipeline
Returns
OdinNative.Wrapper.MediaPipeline: managed effect pipeline
GetPositions(ChannelMask)
Get native position in channel
Returns
OdinNative.Core.Imports.NativeBindings.OdinPosition[]: 3d position array
Parameters
| Type | Name | Description |
|---|---|---|
| OdinNative.Core.Utility.ChannelMask | mask | channel mask to get position from |
GetPosition(ChannelMask)
Get first native position of any channel
Returns
OdinNative.Core.Imports.NativeBindings.OdinPosition: 3d position
Parameters
| Type | Name | Description |
|---|---|---|
| OdinNative.Core.Utility.ChannelMask | mask | channel mask to get position from |
GetChannels()
Get active native channels
Returns
OdinNative.Core.Utility.ChannelMask: channel mask
GetIsSilent()
This reflects the internal silence detection state of the decoder, which updates as audio is processed
Returns
System.Boolean: Returns whether the decoder is currently processing silence
Pop(ref float[], out bool)
Pop output audio from the media
Returns
System.Boolean: true on success or false
Parameters
| Type | Name | Description |
|---|---|---|
System.Single[] | audio | samples |
System.Boolean | isSilent | flag whether the popped buffer contains silence |
Push(float[])
Push output audio into the media for effect processing
Returns
System.Boolean: true on success or false
Parameters
| Type | Name | Description |
|---|---|---|
System.Single[] | datagram | samples |
Push(nint, int)
Returns
System.Boolean
Parameters
| Type | Name |
|---|---|
System.IntPtr | datagramPtr |
System.Int32 | datagramLength |
Dispose(bool)
Parameters
| Type | Name |
|---|---|
System.Boolean | disposing |
Dispose()
Free native media decoder
Implements
- OdinNative.Wrapper.Media.IMedia
System.IDisposable