Skip to main content

StreamingAudioClip

Namespace: MonineEngine.Audio

An AudioClip that supports audio being streamed directly from the disk.

public class StreamingAudioClip

Inheritance ObjectStreamingAudioClip
Attributes NullableContextAttribute, NullableAttribute

Constructors

StreamingAudioClip(String, Int32, AudioChannels)

Constructs a clip instance.

public StreamingAudioClip(string path, int sampleRate, AudioChannels channels)

Parameters

path String
The path to the clip in assets.

sampleRate Int32
The rate of bytes being read per audio buffer. Shouldn't need to be changed.

channels AudioChannels
The channels of the clip. Can be either Mono or Stereo. Defaults to Stereo.

Methods

CreateInstance(Single, Single, Single, Boolean)

Creates an AudioInstance from the clip.

public AudioInstance CreateInstance(float volume, float pitch, float pan, bool loop)

Parameters

volume Single
The volume of the instance. Defaults to 1, ranges from 0 to 1.

pitch Single
The pitch of the instance. Defaults to 0, ranges from -1 to 1.

pan Single
The pan of the instance. Defaults to 0, ranges from -1 to 1.

loop Boolean
Whether the instance loops upon finishing clip playback.

Returns

AudioInstance
The created instance.