Example #1
0
        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();
            }
        }
Example #2
0
        private void TestXbadPcmConvert()
        {
            PlayingForm frmp = new PlayingForm();
            frmp.Show();
            try
            {
                FileHelper.Delete(@"sounds\testXbadPcmOutput.wav");

                Application.DoEvents();

                IPluginAudioExport p = new Xbadpcm();
                p.Convert(@"sounds\testOutput.wav", @"sounds\testXbadPcmOutput.wav", false, 0);

                frmp.Close();

                if (File.Exists(@"sounds\testXbadPcmOutput.wav"))
                {
                    FileInfo fi = new FileInfo(@"sounds\testXbadPcmOutput.wav");
                    if (fi.Length > 100000)
                    {
                        // success

                    }
                    else
                    {
                        throw new XbadPcmConvertException("Xbox PCM conversion failed. Is XBADPCM codec installed?");
                    }
                }
                else
                {
                    throw new XbadPcmConvertException("Xbox PCM output file not created. Is program path writeable?");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                frmp.Close();
                //FileHelper.Delete("testXbadPcmOutput.wav");
            }
        }
Example #3
0
        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();
            }
        }
Example #4
0
        private void TestWavConvert()
        {
            PlayingForm frmp = new PlayingForm();
            frmp.Show();
            try
            {
                FileHelper.Delete(@"sounds\testOutput.wav");

                Application.DoEvents();

                IPluginAudioImport p = new WindowsAudio();
                p.Convert(@"sounds\test.mp3", @"sounds\testOutput.wav");

                frmp.Close();

                if (File.Exists(@"sounds\testOutput.wav"))
                {
                    FileInfo fi = new FileInfo(@"sounds\testOutput.wav");
                    if (fi.Length > 500000)
                    {
                        //success

                    }
                    else
                    {
                        throw new CantConvertMP3Exception("MP3 to Wav Conversion failed. Is the program path writeable?");
                    }
                }
                else
                {
                    throw new CantConvertMP3Exception("Output Wav not created. Is the program path writeable?");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                frmp.Close();
            }
        }
Example #5
0
        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();
            }
        }