From ab67708a62bdf12342de779ca3214e0862aa1e92 Mon Sep 17 00:00:00 2001 From: AShifter Date: Sun, 11 Jun 2017 08:28:32 -0600 Subject: Fix dial-up sound bug Play the sound on a different thread, and BAM IT WORKS WOW YOY and also link the threads so the main thread waits for the sound thread to end something like that just look at Hack1.cs --- TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'TimeHACK.Main/OS/Win95/Win95Apps') diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs b/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs index 4f12ec7..4a2c988 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/Story/Hack1.cs @@ -23,25 +23,22 @@ namespace TimeHACK.OS.Win95.Win95Apps.Story { wm.startWin95(term, "MS-DOS Prompt", null, true, true); - - Thread theThread = new Thread(startObjectMAIN); - - theThread.Start(); + term.WriteLine("192.168.0.1 Connecting..."); + Thread soundThread = new Thread(dialup_sound_play); + soundThread.Start(); + soundThread.Join(); + term.WriteLine("192.168.0.1 Connected."); } - public void startObjectMAIN() + public void dialup_sound_play() { - SoundPlayer startsound; - term.WriteLine("192.168.0.1 Connecting..."); + SoundPlayer dialup_sound; // Play Dial-up Sound Stream audio = Properties.Resources.modem_dial; - startsound = new SoundPlayer(audio); - startsound.Play(); - Thread.Sleep(5000); - startsound.Stop(); - term.WriteLine("192.168.0.1 Connected."); + dialup_sound = new SoundPlayer(audio); + dialup_sound.PlaySync(); } } } -- cgit v1.2.3