// need to figure out how to do this specifically bool CSpeechSynthesizer::SetVoice(std::string* name) { // if we're not initialized return false if (!m_initialized) return false; bool result = false; TCHAR lang[13] = { 0 }; CComPtr<IEnumSpObjectTokens> cpIEnumeration; for (std::map<std::string*, std::string*>::iterator mit = m_tokenMap->begin(); mit != m_tokenMap->end(); mit++) { if (strcmp((*mit).first->c_str(), name->c_str()) == 0) { // Enumerate voice tokens const char* text = (*mit).second->c_str(); int size_needed = MultiByteToWideChar(CP_UTF8, 0, &text[0], (int)strlen(text), NULL, 0); TCHAR tokenId[1024] = { 0 }; MultiByteToWideChar(CP_UTF8, 0, &text[0], (int)strlen(text), &tokenId[0], size_needed); CComPtr<ISpObjectToken> cpTokenObj; HRESULT hr = SpGetTokenFromId(tokenId, &cpTokenObj, false); if (SUCCEEDED(hr)) { result = resetVoice((*mit).second); } break; } } return result; }
void NewProjectAudioProcessor::setParameter (int index, float newValue) { switch (index) { case falloffParam: falloff = newValue; resetVoice(); break; } }