Class SampleFormat
Represents the format of an audio sample.
Inheritance
System.Object
SampleFormat
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Cosmos.HAL.Audio
Assembly: Cosmos.HAL2.dll
Syntax
public class SampleFormat
Constructors
| Improve this Doc View SourceSampleFormat(AudioBitDepth, Byte, Boolean)
Initializes a new instance of the SampleFormat structure.
Declaration
public SampleFormat(AudioBitDepth bitDepth, byte channels, bool signed)
Parameters
Type | Name | Description |
---|---|---|
AudioBitDepth | bitDepth | The bit-depth (bits per a single sample in a channel). |
System.Byte | channels | The amount of channels. |
System.Boolean | signed | Whether the audio is signed, that is, whether the sample can store negative values. By convention, only 8-bit audio samples are unsigned. |
Fields
| Improve this Doc View SourceBitDepth
The audio bit depth, i.e. how many bits are used per a single channel in a sample.
Declaration
public AudioBitDepth BitDepth
Field Value
Type | Description |
---|---|
AudioBitDepth |
Channels
The amount of channels per a single sample.
Declaration
public readonly byte Channels
Field Value
Type | Description |
---|---|
System.Byte |
Signed
A value indicating whether the audio samples are signed or unsigned. By convention, only 8-bit audio samples are unsigned.
Declaration
public readonly bool Signed
Field Value
Type | Description |
---|---|
System.Boolean |
Size
The size of a single audio sample (frame).
Declaration
public readonly int Size
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceChannelSize
The amount of bytes per a single audio channel.
Declaration
public int ChannelSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceAsSingleChannel()
Returns a copy of this SampleFormat that represents a single channel of a sample.
Declaration
public SampleFormat AsSingleChannel()
Returns
Type | Description |
---|---|
SampleFormat |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
Operators
| Improve this Doc View SourceEquality(SampleFormat, SampleFormat)
Declaration
public static bool operator ==(SampleFormat lhs, SampleFormat rhs)
Parameters
Type | Name | Description |
---|---|---|
SampleFormat | lhs | |
SampleFormat | rhs |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(SampleFormat, SampleFormat)
Declaration
public static bool operator !=(SampleFormat lhs, SampleFormat rhs)
Parameters
Type | Name | Description |
---|---|---|
SampleFormat | lhs | |
SampleFormat | rhs |
Returns
Type | Description |
---|---|
System.Boolean |