Skip to content

AudioAPI reference

Class EncodedAudio

Namespace: MicroEngine.Audio
Assembly: MicroEngine.Audio.dll
Guide: Audio

The bytes of a music file loaded from content (the “music” asset kind) and its format (“wav”, “ogg”, “mp3”): music is decoded while it plays rather than all at once.

C#
public sealed class EncodedAudio

Inheritance

object ← EncodedAudio

Constructors

EncodedAudio(byte[], string)

Wraps a music file’s bytes without copying them.

C#
public EncodedAudio(byte[] data, string format)

Parameters

data byte[]

The whole file.

format string

Its format, the file extension without the dot (“ogg”); compared without regard to case.

Exceptions

ArgumentException

format is null, empty or white space.

Properties

Data

The file’s bytes. The array is not copied.

C#
public byte[] Data { get; }

Property Value

byte[]

Format

The format, lower case without the dot: “wav”, “ogg”, “mp3”.

C#
public string Format { get; }

Property Value

string