public void PlayMusic(AudioReference reference) { //@"C:\Program Files\Maxis\The Sims Online\TSOClient\music\stations\countryd\cntryd1_5df26ad0.mp3" var file = Load(reference.FilePath); ; //var file = Load(@"C:\Program Files\Maxis\The Sims Online\TSOClient\sounddata\tvstations\tv_comedy_cartoon\tv_c1_12.xa"); ; var output = new DirectSoundOut(); output.Init(file); output.Play(); }
public void Init() { this.Stations = new List<AudioReference>(); this.StationsById = new Dictionary<uint, AudioReference>(); this.Modes = new List<AudioReference>(); var stationsRegEx = new Regex(@"music\\stations\\.*\.mp3"); foreach (var file in ContentManager.AllFiles){ if (stationsRegEx.IsMatch(file)){ var reference = new AudioReference { Type = AudioType.RADIO_STATION, FilePath = ContentManager.GetPath(file) }; Stations.Add(reference); var idString = Path.GetFileNameWithoutExtension(file); idString = idString.Substring(idString.LastIndexOf("_") + 1); var id = Convert.ToUInt32(idString, 16); reference.ID = id; StationsById.Add(id, reference); } } var tsoAudio = new DBPF(ContentManager.GetPath("TSOAudio.dat")); }