Skip to content

Commit

Permalink
defaultオプション生成関数にmakeをつけた 
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty2501 committed Aug 25, 2022
1 parent f6e4d9b commit a9c2cee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions crates/voicevox_core_c_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub struct VoicevoxInitializeOptions {
}

#[no_mangle]
pub extern "C" fn voicevox_default_initialize_options() -> VoicevoxInitializeOptions {
pub extern "C" fn voicevox_make_default_initialize_options() -> VoicevoxInitializeOptions {
VoicevoxInitializeOptions::default()
}

Expand Down Expand Up @@ -184,7 +184,7 @@ pub struct VoicevoxAudioQueryOptions {
}

#[no_mangle]
pub extern "C" fn voicevox_default_audio_query_options() -> VoicevoxAudioQueryOptions {
pub extern "C" fn voicevox_make_default_audio_query_options() -> VoicevoxAudioQueryOptions {
voicevox_core::AudioQueryOptions::default().into()
}

Expand Down Expand Up @@ -213,7 +213,7 @@ pub struct VoicevoxSynthesisOptions {
enable_interrogative_upspeak: bool,
}

pub extern "C" fn voicevox_default_synthesis_options() -> VoicevoxSynthesisOptions {
pub extern "C" fn voicevox_make_default_synthesis_options() -> VoicevoxSynthesisOptions {
VoicevoxSynthesisOptions::default()
}

Expand Down Expand Up @@ -258,7 +258,7 @@ pub struct VoicevoxTtsOptions {
}

#[no_mangle]
pub extern "C" fn voicevox_default_tts_options() -> VoicevoxTtsOptions {
pub extern "C" fn voicevox_make_default_tts_options() -> VoicevoxTtsOptions {
voicevox_core::TtsOptions::default().into()
}

Expand Down
8 changes: 4 additions & 4 deletions example/cpp/unix/simple_tts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main(int argc, char *argv[]) {

std::cout << "coreの初期化中..." << std::endl;

auto initialize_options = voicevox_default_initialize_options();
auto initialize_options = voicevox_make_default_initialize_options();
initialize_options.load_all_models = true;
initialize_options.open_jtalk_dict_dir = open_jtalk_dict_path.c_str();
if (voicevox_initialize(initialize_options) != VOICEVOX_RESULT_SUCCEED) {
Expand All @@ -31,9 +31,9 @@ int main(int argc, char *argv[]) {
int output_binary_size = 0;
uint8_t *output_wav = nullptr;

auto result =
voicevox_tts(text.c_str(), speaker_id, voicevox_default_tts_options(),
&output_binary_size, &output_wav);
auto result = voicevox_tts(text.c_str(), speaker_id,
voicevox_make_default_tts_options(),
&output_binary_size, &output_wav);
if (result != VOICEVOX_RESULT_SUCCEED) {
std::cout << voicevox_error_result_to_message(result) << std::endl;
return 1;
Expand Down

0 comments on commit a9c2cee

Please sign in to comment.