namespace OpenVIII.AV { using FFmpeg.AutoGen; public class Audio : Ffcc { #region Methods /// /// Opens filename and init class. /// public static Audio Load(string filename, int loopstart = -1) => Load(filename, AVMediaType.AVMEDIA_TYPE_AUDIO, FfccMode.STATE_MACH, loopstart); /// /// Opens filename and init class. /// /// /// Could be better, but theres alot of hoops to jump through. /// /// /// /// public static unsafe Audio Play(BufferData buffer_Data, byte[] headerData, int loopstart = -1) { Audio r = new Audio(); fixed (byte* tmp = &headerData[0]) { lock (r.Decoder) { buffer_Data.SetHeader(tmp); r.LoadFromRAM(&buffer_Data); r.Init(null, AVMediaType.AVMEDIA_TYPE_AUDIO, FfccMode.PROCESS_ALL, loopstart); ffmpeg.avformat_free_context(r.Decoder.Format); //ffmpeg.avio_context_free(&Decoder._format->pb); //CTD r.Decoder.Format = null; } r.Dispose(false); } return r; } #endregion Methods } }