Source

gnome-record-screen / GNOME-Record-Screen / src / AudioEncoderImplementations.cs

Full commit
/**
 * AudioEncoderImplementations.cs
 *
 * :copyright: 2008 mitsuhiko.
 * :license: BSD
 */

using System;

namespace Gnome.RecordScreen.Implementations {
	
	internal class VorbisAudioEncoder : AudioEncoder {
		
		public VorbisAudioEncoder ()
			: base ("vorbisenc")
		{}
		
		public override string GetEncoderArguments (AudioQuality quality)
		{
			switch (quality) {
			case AudioQuality.High:
				return "quality=0.7";
			case AudioQuality.Medium:
				return "quality=0.5";
			case AudioQuality.Low:
				return "quality=0.25";
			}
			return null;
		}
	}
	
	internal class Mp3AudioEncoder : AudioEncoder {

		public Mp3AudioEncoder ()
			: base ("lame")
		{}
		
		public override string GetEncoderArguments (AudioQuality quality)
		{
			switch (quality) {
			case AudioQuality.High:
				return "quality=2";
			case AudioQuality.Medium:
				return "quality=5";
			case AudioQuality.Low:
				return "quality=8";
			}
			return null;
		}
	}
	
	internal class NullAudioEncoder : AudioEncoder {
		
		public NullAudioEncoder ()
			: base (null)
		{}
		
		public override bool IsAvailable {
			get { return false; }
		}
	}
}