Skip to content

Commit

Permalink
Windowsのサンプルを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty2501 committed Feb 23, 2023
1 parent 1bde581 commit a83538b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/cpp/windows/simple_tts/simple_tts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -65,8 +66,7 @@ int main() {
std::wcout << L"音声データの開放" << std::endl;
voicevox_wav_free(output_wav);

voicevox_finalize();

voicevox_synthesizer_delete(synthesizer);
}

/// <summary>
Expand Down

0 comments on commit a83538b

Please sign in to comment.