public static AudioEncoder Create(AudioEncoderConfigs c, string path) { var ret = Create(c.format); switch (c.format) { case Type.Wave: ret.Initialize(c.waveEncoderSettings, path); break; case Type.Ogg: ret.Initialize(c.oggEncoderSettings, path); break; case Type.Flac: ret.Initialize(c.flacEncoderSettings, path); break; } return(ret); }