Exemple #1
0
        void CheckIfAllSoundFilesExistOrNot()
        {
            if (ApplicationCommonSettings.IsDebugging == false)
            {
                return;
            }

            var hasAllFiles = true;

            try
            {
                var audioPlayer = new NAudioWrapper();
                var messages    = new NarrationInformationList();
                var props       = messages.GetType().GetProperties();
                foreach (var prop in props)
                {
                    var msg      = (NarrationInformation)prop.GetValue(messages);
                    var filePath = CurrentResources.SoundFilesFolderPath + msg.OggAudioFileName;
                    var hr       = audioPlayer.StartAsync(filePath);
                    if (hr == false)
                    {
                        hasAllFiles = false;
                        break;
                    }
                }
                audioPlayer.Stop();
            }
            catch (Exception ex)
            {
                hasAllFiles = false;
                MessageBox.Show(ex.Message);
            }
            if (hasAllFiles == false)
            {
                throw new Exception("Application could not find one or more sound files, or application could not play the sound file on the current sound device.");
            }
        }
Exemple #2
0
 public ZkooTutorialResourcesModel()
 {
     Messages = new NarrationInformationList();
 }