Ejemplo n.º 1
0
        public AudioPlayer(ISpeechSynthesizer speechSynth, IConfigSettings configSettings, 
						   VoiceSelector voiceSelector, IAppLocation appLocation)
        {
            _voiceSelector = voiceSelector;
            _speechVoiceName = configSettings.SpeechVoiceName;
            _playSounds = configSettings.PlaySounds;
            _playSpeech = configSettings.PlaySpeech;
            _wavFileFolder = Path.Combine(appLocation.DirectoryName, "sounds");

            _speechSynth = speechSynth;
            _speechSynth.Rate = -2;		//TODO might be useful as configuration

            configSettings.AddObserver(this);
        }
Ejemplo n.º 2
0
        public AudioPlayer(ISpeechSynthesizer speechSynth, IConfigSettings configSettings,
                           VoiceSelector voiceSelector, IAppLocation appLocation)
        {
            _voiceSelector   = voiceSelector;
            _speechVoiceName = configSettings.SpeechVoiceName;
            _playSounds      = configSettings.PlaySounds;
            _playSpeech      = configSettings.PlaySpeech;
            _wavFileFolder   = Path.Combine(appLocation.DirectoryName, "sounds");

            _speechSynth      = speechSynth;
            _speechSynth.Rate = -2;                     //TODO might be useful as configuration

            configSettings.AddObserver(this);
        }
        /// <summary>
        /// probably hacky code, but the designer shows again, feel free to clean this up
        /// got no experience with ninject
        /// </summary>
        public override void Load()
        {
            //for the speech converter
            Bind<ISpeechSynthesizer>().ToConstant(new CradiatorSpeechSynthesizer(new SpeechSynthesizer()));

            var ss = new SpeechSynthesizer();

            var css = new CradiatorSpeechSynthesizer(ss);
            var vs = new VoiceSelector(css);

            Bind<InstalledVoiceConverter>().ToConstant(new InstalledVoiceConverter( vs ));

            //for the build breakers
            var fs = new FixerStrategy();
            var bs = new BuildBuster( new Config.ConfigSettings(), fs, new GuiltFactory());
            Bind<IBuildBuster>().ToConstant(bs);
        }
Ejemplo n.º 4
0
 public InstalledVoiceConverter(VoiceSelector voiceSelector)
 {
     _voiceSelector = voiceSelector;
 }
Ejemplo n.º 5
0
 public void SetUp()
 {
     _speechSynth = MockRepository.GenerateMock<ISpeechSynthesizer>();
     _voiceSelector = new VoiceSelector(_speechSynth);
 }