mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 10:05:44 +00:00
28 lines
783 B
C#
28 lines
783 B
C#
using FFMpegCore.Enums;
|
|
using FFMpegCore.Exceptions;
|
|
|
|
namespace FFMpegCore.Arguments
|
|
{
|
|
/// <summary>
|
|
/// Represents parameter of audio codec and it's quality
|
|
/// </summary>
|
|
public class AudioCodecArgument : IArgument
|
|
{
|
|
public readonly string AudioCodec;
|
|
|
|
public AudioCodecArgument(Codec audioCodec)
|
|
{
|
|
if (audioCodec.Type != CodecType.Audio)
|
|
throw new FFMpegException(FFMpegExceptionType.Operation, $"Codec \"{audioCodec.Name}\" is not an audio codec");
|
|
|
|
AudioCodec = audioCodec.Name;
|
|
}
|
|
|
|
public AudioCodecArgument(string audioCodec)
|
|
{
|
|
AudioCodec = audioCodec;
|
|
}
|
|
|
|
public string Text => $"-c:a {AudioCodec.ToString().ToLowerInvariant()}";
|
|
}
|
|
}
|