MIDIPlayer::MIDIPlayer(){ if(midiOutOpen(&mid,(UINT)-1,0,0,0)) exit(1); velocity = 127; setVoice(0); // default }
void OscillatorPanel::OnChoiceUpdate( wxCommandEvent &event ) { int val = event.GetSelection(); switch (event.GetId()) { case VOICE_CHOICE: setVoice(val); break; } }
// ---------------------------------------------------------- bool ofxAudioUnitSpeechSynth::setVoice(const std::string &voiceName) // ---------------------------------------------------------- { std::vector<std::string> voiceNames = getAvailableVoices(); for(int i = 0; i < voiceNames.size(); i++) { if(voiceNames.at(i) == voiceName) { return setVoice(i+1); } } return false; }
void OscillatorPanel::setInstrument(Instrument* inst) { if (this->inst != 0) { removeCalbacks(); } this->inst = inst; oscillatorCanvas->setInstrument(inst); if (this->inst != 0) { voiceChoice->Enable(true); setVoice(selectedVoice); } else { voiceChoice->Enable(false); voiceBox->Show(false); } }
/** @param mode 'v' to set voice, 'a' to set admin, 'h' to set halfop, 'o' to set op. * @param state what to set the mode to. */ bool ChannelNick::setMode(char mode, bool state) { switch (mode) { case 'q': return setOwner(state); case 'a': return setAdmin(state); case 'o': return setOp(state); case 'h': return setHalfOp(state); case 'v': return setVoice(state); default: qDebug() << "Mode '" << mode << "' not recognised in setModeForChannelNick"; return false; } }
void Agent::finishInit() { // lc2e, at least, seems to position agents centered on (-9876,-9876) to begin with // TODO: where should we place agents in other games? is this code right at all anyway? // (bear in mind that there are no parts present for some C1/C2 agents when finishInit is called, atm) if (engine.version > 2 && !engine.bmprenderer) { // TODO: need to think about bmp-specific code some more x = -9876.0f + (getWidth() / 2.0f); y = -9876.0f + (getHeight() / 2.0f); } // shared_from_this() can only be used if these is at least one extant // shared_ptr which owns this world.agents.push_front(boost::shared_ptr<Agent>(this)); agents_iter = world.agents.begin(); if (engine.version > 2 && findScript(10)) queueScript(10); // constructor if (!voice && engine.version == 3) { setVoice("DefaultVoice"); } initialized = true; }
//------------------------------------------------------------------------------ bool SpeechApi51::load() { if (isLoaded()) { return true; } CoInitialize(NULL); if (FAILED(CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, reinterpret_cast<void **>(&m_sapi)))) { return false; } m_state = TextToSpeech::State_Loaded; // adjust the volume and rate settings setVoice(m_voice); setVolume(m_volume); setRate(m_rate); return true; }
bool ArSpeechSynth::processConfig() { setVoice(myConfigVoice); return true; }
void MainBottomWidget::voiceChanged(qreal pos) { m_currentVoice->setText(QString::number((int)(pos * 100), 10)); emit setVoice( (int)(pos * 100)); }