public SequenceRecorder(Conductor cond, KeyboardConfiguration key)
        {
            conductor = cond;
            keyboard = key;

            InitializeComponent();

            int waveInDevices = NAudio.Wave.WaveIn.DeviceCount;
            for (int waveInDevice = 0; waveInDevice < waveInDevices; waveInDevice++)
            {
                NAudio.Wave.WaveInCapabilities deviceInfo = NAudio.Wave.WaveIn.GetCapabilities(waveInDevice);
                microphoneList.Items.Add(waveInDevice+": "+deviceInfo.ProductName);
            }

            microphoneList.SelectedIndex = 0;
            sensitivity.SelectedIndex = 0;

            sourceStream = new NAudio.Wave.WaveIn();
            sourceStream.DeviceNumber = 0;
            sourceStream.WaveFormat = conductor.GetWaveFormat();// new NAudio.Wave.WaveFormat(44100, NAudio.Wave.WaveIn.GetCapabilities(0).Channels);
            bytesPerChannel = (sourceStream.WaveFormat.BitsPerSample / 8);
            bytesPerSample = bytesPerChannel * sourceStream.WaveFormat.Channels;

            sourceStream.DataAvailable += new EventHandler<NAudio.Wave.WaveInEventArgs>(sourceStream_DataAvailable);

            sourceStream.StartRecording();
        }
        public Face_Detect_and_Greet(RoboRealm.RR_API robo, Conductor cond)
        {
            rr = robo;
            conductor = cond;

            InitializeComponent();

            Thread thread = new Thread(new ThreadStart(WorkThreadFunction));
            thread.Start();
        }
Example #3
0
        public Speak(Conductor c, String text, int voiceIndex)
        {
            conductor = c;

            tokens = spVoice.GetVoices("", "");

            //currentVoiceIndex = comboBoxVoice.SelectedIndex;
            if (voiceIndex < 0) voiceIndex = 0;
            if (tokens.Count > 0)
            {
                spVoice.SetVoice((ISpObjectToken)tokens.Item(voiceIndex));
                spVoice.Viseme += new _ISpeechVoiceEvents_VisemeEventHandler(voice_Viseme);
                spVoice.Speak(text, SpeechVoiceSpeakFlags.SVSFlagsAsync);
            }
        }
 public void SetConductor(ref Conductor c)
 {
     conductor = c;
 }