internal Narrator(Random random, INarrationSettings settings, IAudioProviderFactory factory, ITextToAudioProvider textToAudioProvider, IActivityDisplayProvider activityDisplayProvider)
        {
            _settings            = settings;
            _audioProvider       = factory.Create(settings);
            _textToAudioProvider = textToAudioProvider;
            _random = random;

            _activityDisplayProvider = activityDisplayProvider;
        }
        internal static int GetMysteryIndex(INarrationSettings settings)
        {
            int mysteryIndex;

            switch (settings.Device)
            {
            case "":
                mysteryIndex = AudioProvider.Default;
                break;

            case "None":
                mysteryIndex = AudioProvider.Null;
                break;

            default:
                var index = AudioDeviceEnumerator.GetDeviceIndex(settings.Device);
                mysteryIndex = 0 <= index ? index : AudioProvider.Default;
                break;
            }

            return(mysteryIndex);
        }
        ITextToAudioProvider ITextToAudioProviderFactory.Create(INarrationSettings settings)
        {
            var provider = new TextToAudioProvider(settings);

            return(provider);
        }
 internal AudioProvider(INarrationSettings settings)
 {
     _settings = settings;
 }
Beispiel #5
0
        internal TextToAudioProvider(INarrationSettings settings)
        {
            _voiceDefault = _synthesizer.Voice.Name;

            _settings = settings;
        }
        /// <summary>
        /// Create a speech provider.
        /// </summary>
        /// <param name="settings">Settings to use.</param>
        /// <returns></returns>
        public IAudioProvider Create(INarrationSettings settings)
        {
            var provider = new AudioProvider(settings);

            return(provider);
        }