Class ACMOutput
- Namespace
- VisioForge.Core.Types.Output
- Assembly
- VisioForge.Core.dll
Represents configuration settings for Audio Compression Manager (ACM) and PCM audio output.
public sealed class ACMOutput : IVideoCaptureBaseOutput, IVideoEditBaseOutputInheritance
Implements
Inherited Members
Remarks
This class provides settings for configuring audio output using Windows Audio Compression Manager (ACM) codecs or uncompressed PCM (Pulse Code Modulation) format. ACM provides access to various audio codecs installed on the Windows system, while PCM represents raw, uncompressed audio data.
The class implements both VisioForge.Core.Types.Output.IVideoCaptureBaseOutput and VisioForge.Core.Types.Output.IVideoEditBaseOutput interfaces, making it suitable for both video capture and video editing scenarios.
Constructors
ACMOutput()
Initializes a new instance of the VisioForge.Core.Types.Output.ACMOutput class with default settings.
public ACMOutput()Remarks
Default configuration:
- Codec: PCM (uncompressed)
- Bits per sample: 16
- Sample rate: 44100 Hz (CD quality)
- Channels: 2 (stereo)
- Compression: Enabled
These defaults provide CD-quality audio output suitable for most applications.
Properties
BPS
Gets or sets the bits per sample (bit depth) for the current audio codec.
public int BPS { get; set; }Property Value
Remarks
The bits per sample determines the dynamic range and quality of the audio:
- 8-bit: Lower quality, smaller file size (48 dB dynamic range)
- 16-bit: CD quality, good balance of quality and size (96 dB dynamic range)
- 24-bit: Professional quality (144 dB dynamic range)
- 32-bit: Highest quality, typically used for audio processing
Some codecs may ignore this parameter or force a specific bit depth based on their specifications. Compressed codecs often use their own internal representation regardless of this setting.
Channels
Gets or sets the number of audio channels for the current audio codec.
public int Channels { get; set; }Property Value
Remarks
Common channel configurations:
- 1: Mono (single channel)
- 2: Stereo (left and right channels)
- 6: 5.1 surround sound (if supported by the codec)
- 8: 7.1 surround sound (if supported by the codec)
Not all codecs support multi-channel audio. Some codecs may automatically downmix multi-channel audio to stereo or mono if they don't support the requested number of channels.
Name
Gets or sets the name of the audio codec to use.
public string Name { get; set; }Property Value
Remarks
This property specifies which audio codec to use for compression. Common values include:
- "PCM": Uncompressed audio (no compression)
- "MP3": MPEG-1 Audio Layer 3 (requires MP3 ACM codec)
- "Microsoft ADPCM": Adaptive Differential PCM
- "GSM 6.10": GSM compression for telephony
- "Windows Media Audio V2": WMA compression
The available codecs depend on what ACM codecs are installed on the system. Use "PCM" for uncompressed audio when quality is paramount and file size is not a concern.
SampleRate
Gets or sets the audio sample rate in Hz (samples per second).
public int SampleRate { get; set; }Property Value
Remarks
Common sample rates and their typical uses:
- 8000 Hz: Telephone quality
- 11025 Hz: Low quality (quarter CD quality)
- 22050 Hz: Radio quality (half CD quality)
- 44100 Hz: CD quality (standard for music)
- 48000 Hz: Professional audio/video (DVD, digital TV)
- 96000 Hz: High-resolution audio
- 192000 Hz: Ultra high-resolution audio
Higher sample rates provide better frequency response but result in larger file sizes. The Nyquist theorem states that the sample rate must be at least twice the highest frequency you want to capture (e.g., 44.1 kHz can capture up to 22.05 kHz).
UseCompression
Gets or sets a value indicating whether audio compression is enabled.
public bool UseCompression { get; set; }Property Value
Remarks
When compression is enabled, the audio will be compressed using the codec specified in the VisioForge.Core.Types.Output.ACMOutput.Name property. When disabled, the audio will be stored as uncompressed PCM regardless of the codec name setting.
Disabling compression results in higher quality audio but significantly larger file sizes. Enable compression when file size is a concern or when streaming audio over networks.
Methods
GetInternalTypeVC()
Gets the internal output format identifier for video capture operations.
public VideoCaptureOutputFormat GetInternalTypeVC()Returns
- VideoCaptureOutputFormat
-
Returns VisioForge.Core.Types.VideoCapture.VideoCaptureOutputFormat.PCM_ACM to indicate this is an ACM/PCM audio output.
Remarks
This method is used internally by the video capture system to identify the output format type. It implements the VisioForge.Core.Types.Output.IVideoCaptureBaseOutput.GetInternalTypeVC interface method.
GetInternalTypeVE()
Gets the internal output format identifier for video editing operations.
public VideoEditOutputFormat GetInternalTypeVE()Returns
- VideoEditOutputFormat
-
Returns VisioForge.Core.Types.VideoEdit.VideoEditOutputFormat.PCM_ACM to indicate this is an ACM/PCM audio output.
Remarks
This method is used internally by the video editing system to identify the output format type. It implements the VisioForge.Core.Types.Output.IVideoEditBaseOutput.GetInternalTypeVE interface method.
Load(string)
Deserializes ACM output settings from a JSON string.
public static ACMOutput Load(string json)Parameters
jsonstring-
The JSON string containing the serialized ACM output settings.
Returns
- ACMOutput
-
A new VisioForge.Core.Types.Output.ACMOutput instance with settings restored from the JSON string.
Remarks
This method uses the default JSON deserialization options from VisioForge.Core.Helpers.JsonSerializerOptionsHelper. The JSON string should have been created using the VisioForge.Core.Types.Output.ACMOutput.Save method or follow the same format.
Exceptions
- JsonException
-
Thrown when the JSON string is invalid or cannot be deserialized to an ACMOutput object.
Save()
Serializes the current ACM output settings to a JSON string.
public string Save()Returns
- string
-
A JSON string representation of the current settings that can be persisted or transmitted.
Remarks
This method uses the default JSON serialization options from VisioForge.Core.Helpers.JsonSerializerOptionsHelper. The resulting JSON can be used to restore the settings later using the VisioForge.Core.Types.Output.ACMOutput.Load(System.String) method. All public properties of the class will be included in the serialization.