コード例 #1
0
MIDIPlayer::MIDIPlayer(){
	if(midiOutOpen(&mid,(UINT)-1,0,0,0))
		exit(1);
		
	velocity = 127;
	setVoice(0); // default
}
コード例 #2
0
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;
}
コード例 #4
0
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);
  }
}
コード例 #5
0
ファイル: channelnick.cpp プロジェクト: KDE/konversation
/** @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;
    }
}
コード例 #6
0
ファイル: Agent.cpp プロジェクト: JennaMalkin/openc2e
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;
}
コード例 #7
0
ファイル: SpeechApi51.cpp プロジェクト: Seldom/miranda-ng
//------------------------------------------------------------------------------
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;
}
コード例 #8
0
ファイル: ArSpeech.cpp プロジェクト: Aharobot/ArAndroidApp
bool ArSpeechSynth::processConfig()
{
  setVoice(myConfigVoice);
  return true;
}
コード例 #9
0
ファイル: mainbottomwidget.cpp プロジェクト: Unymicle/NetEase
void MainBottomWidget::voiceChanged(qreal pos)
{
	m_currentVoice->setText(QString::number((int)(pos * 100), 10));
	emit setVoice( (int)(pos * 100));
}