internal static ModuleAudio FromModel(Model.Audio.ModuleAudio audio) => new ModuleAudio { Identifier = ModuleIdentifier.FromModel(audio.Schema.Identifier), Format = AudioFormat.FromModel(audio.Format), DurationPerInstrument = Duration.FromTimeSpan(audio.DurationPerInstrument), InstrumentCaptures = { audio.Captures.Select(InstrumentAudio.FromModel) } };
/// <summary> /// Saves module audio data to the specified stream. /// </summary> /// <param name="audio">The audio data to save. Must not be null.</param> /// <param name="stream">The stream to save the data to. Must not be null.</param> public static void Save(this Model.Audio.ModuleAudio audio, Stream stream) => ProtoIo.Write(stream, audio);