public List <Sample> GetMixSectionsAsSamples(Track track) { var bassTrack = BassPlayer.LoadTrackAndAudio(track.Filename); var samples = new List <Sample>(); var fadeIn = new Sample { Description = "FadeIn", Start = bassTrack.SamplesToSeconds(bassTrack.FadeInStart), Length = bassTrack.FadeInLengthSeconds, Bpm = BpmHelper.GetBpmFromLoopLength(bassTrack.FadeInLengthSeconds), Gain = bassTrack.Gain }; UpdateSampleFromTrack(fadeIn, track); samples.Add(fadeIn); var fadeOut = new Sample { Description = "FadeOut", Start = bassTrack.SamplesToSeconds(bassTrack.FadeOutStart), Length = bassTrack.FadeOutLengthSeconds, Bpm = BpmHelper.GetBpmFromLoopLength(bassTrack.FadeOutLengthSeconds), Gain = bassTrack.Gain }; UpdateSampleFromTrack(fadeOut, track); samples.Add(fadeOut); BassPlayer.UnloadTrackAudioData(bassTrack); return(samples); }