Class MemoryAudioStream
Represents an audio stream that reads from a byte array in memory.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.System.Audio.IO
Assembly: Cosmos.System2.dll
Syntax
public class MemoryAudioStream : SeekableAudioStream
Constructors
| Improve this Doc View SourceMemoryAudioStream(SampleFormat, UInt32, Byte[])
Initializes a new instance of the MemoryAudioStream class.
Declaration
public MemoryAudioStream(SampleFormat format, uint sampleRate, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
SampleFormat | format | The format of the provided audio data. |
System.UInt32 | sampleRate | |
System.Byte[] | data | The audio data. |
Properties
| Improve this Doc View SourceDepleted
Declaration
public override bool Depleted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceFormat
Declaration
public SampleFormat Format { get; set; }
Property Value
Type | Description |
---|---|
SampleFormat |
Length
Declaration
public override uint Length { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Overrides
| Improve this Doc View SourcePosition
Declaration
public override uint Position { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Overrides
| Improve this Doc View SourceSampleRate
Declaration
public override uint SampleRate { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Overrides
Methods
| Improve this Doc View SourceFromWave(Byte[])
Creates a MemoryAudioStream from a PCM-encoded WAVE (.wav) file. The file has to have a valid header.
Declaration
public static MemoryAudioStream FromWave(byte[] waveFile)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | waveFile | The target wave file. |
Returns
Type | Description |
---|---|
MemoryAudioStream |
Read(AudioBuffer)
Declaration
public override void Read(AudioBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
AudioBuffer | buffer |