Struct RAWBaseAudioInfo
- Namespace
- VisioForge.Core.Types
- Assembly
- VisioForge.Core.dll
Represents fundamental information about a raw audio stream. This struct provides details such as the sample container width, number of channels, sample rate, and audio format.
public struct RAWBaseAudioInfoInherited Members
Remarks
This struct is critical for interoperation with unmanaged code and is marked with [StructLayout(LayoutKind.Sequential)]
to ensure its memory layout matches native structures. Do not modify its structure without careful consideration of compatibility.
The BPS field indicates the width of one sample's container in bits, which is not always its
bit depth - see the field's own documentation.
Channels typically range from 1 (mono) to 2 (stereo) for common audio, but can be higher for surround sound (5.1 = 6 channels, 7.1 = 8 channels).
SampleRate is measured in Hz and determines the audio quality and frequency range - 44100 Hz is CD quality, 48000 Hz is DVD/professional quality.
The Format field disambiguates between different representations of the same bit depth (e.g., PCM16 vs IEEE32).
This struct is used throughout the framework to describe audio streams in a consistent, platform-independent manner.
Fields
BPS
Gets or sets the width of one sample's CONTAINER in bits - what to divide by 8 for the bytes a sample occupies in VisioForge.Core.Types.RAWAudioFrame.Data. Common values are 8, 16, 24, 32 and 64.
It is not always the number of significant bits: a 24-bit sample carried in a 32-bit container reports 32, and 20- and 18-bit samples, which GStreamer carries in three bytes, report 24. VisioForge.Core.Types.RAWBaseAudioInfo.Format is the other half of the pair - it names the representation, this names the size - and formats with no matching VisioForge.Core.Types.AudioFormat member report VisioForge.Core.Types.AudioFormat.Unknown there rather than the nearest one.
public int BPSField Value
Channels
Gets or sets the number of audio channels. Common values are 1 for mono, 2 for stereo.
public int ChannelsField Value
Format
Gets or sets the VisioForge.Core.Types.AudioFormat of the audio data. This specifies whether the data is PCM, IEEE float, and its bit depth type.
public AudioFormat FormatField Value
SampleRate
Gets or sets the sample rate of the audio stream in Hertz (Hz). Common values include 44100 Hz (CD quality) or 48000 Hz.
public int SampleRateField Value
Methods
ToString()
Returns a string that represents the current VisioForge.Core.Types.RAWBaseAudioInfo instance. The string includes the bits per sample, channels, sample rate, and audio format.
public override string ToString()