diff --git a/example/cpp/windows/simple_tts/simple_tts.cpp b/example/cpp/windows/simple_tts/simple_tts.cpp index 5c348235b..c5f29c1e0 100644 --- a/example/cpp/windows/simple_tts/simple_tts.cpp +++ b/example/cpp/windows/simple_tts/simple_tts.cpp @@ -34,7 +34,8 @@ int main() { initializeOptions.load_all_models = true; VoicevoxResultCode result = VoicevoxResultCode::VOICEVOX_RESULT_OK; - result = voicevox_initialize(initializeOptions); + VoicevoxSynthesizer* synthesizer; + result = voicevox_synthesizer_new_with_initialize(initializeOptions,&synthesizer); if (result != VoicevoxResultCode::VOICEVOX_RESULT_OK) { OutErrorMessage(result); return 0; @@ -46,7 +47,7 @@ int main() { uint8_t* output_wav = nullptr; VoicevoxTtsOptions ttsOptions = voicevox_make_default_tts_options(); - result = voicevox_tts(wide_to_utf8_cppapi(speak_words).c_str(), speaker_id, ttsOptions, &output_binary_size, &output_wav); + result = voicevox_synthesizer_tts(synthesizer,wide_to_utf8_cppapi(speak_words).c_str(), speaker_id, ttsOptions, &output_binary_size, &output_wav); if (result != VoicevoxResultCode::VOICEVOX_RESULT_OK) { OutErrorMessage(result); return 0; @@ -65,8 +66,7 @@ int main() { std::wcout << L"音声データの開放" << std::endl; voicevox_wav_free(output_wav); - voicevox_finalize(); - + voicevox_synthesizer_delete(synthesizer); } ///