private void TestOgg() { PlayingForm frmp = new PlayingForm(); frmp.Show(); try { Application.DoEvents(); AudioTests audioTester = new AudioTests(); audioTester.PlayTest(Application.StartupPath + @"\sounds\test.ogg"); frmp.Close(); if (MessageBox.Show("Did you hear the audio?", "Did you hear?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { // success } else { throw new OggPlaybackException("You couldn't hear the audio. Check the Ogg codec is installed"); } } catch (Exception ex) { throw ex; } finally { frmp.Close(); } }
private void TestXboxWavPlay() { PlayingForm frmp = new PlayingForm(); frmp.Show(); try { Application.DoEvents(); AudioTests audioTester = new AudioTests(); audioTester.PlayTest(@"sounds\testXbadPcmOutput.wav"); frmp.Close(); if (MessageBox.Show("Did you hear the audio?", "Did you hear?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //success } else { throw new CantPlayMp3Exception("You couldn't hear the converted XBADPCM audio. Make sure you have the codec installed correctly and the Priority set to 1"); } } catch (Exception ex) { throw ex; } finally { frmp.Close(); } }
private void TestMp3() { PlayingForm frmp = new PlayingForm(); frmp.Show(); try { Application.DoEvents(); AudioTests tester = new AudioTests(); tester.PlayTest(@"sounds\test.mp3"); frmp.Close(); if (MessageBox.Show("Did you hear the audio?", "Did you hear?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //success } else { throw new CantPlayMp3Exception("You couldn't hear the audio. Check you have an MP3 codec installed. Check the sound card is installed properly."); } } catch (Exception ex) { throw ex; } finally { frmp.Close(); } }