Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include文の記述を整理 #96

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ elseif (UNIX)
endif ()

target_compile_options(core PRIVATE
$<$<CXX_COMPILER_ID:MSVC>: /W4 /O2 /utf-8>
$<$<CXX_COMPILER_ID:GNU>: -Wall -Wextra -O2>
$<$<CXX_COMPILER_ID:MSVC>: /W4 /O2 /utf-8 /DVOICEVOX_CORE_EXPORTS>
$<$<CXX_COMPILER_ID:GNU>: -Wall -Wextra -O2 -DVOICEVOX_CORE_EXPORTS>
)
target_include_directories(core
PRIVATE ${ONNXRUNTIME_DIR}/include
Expand Down
3 changes: 2 additions & 1 deletion core/src/core.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <onnxruntime_cxx_api.h>

#include <array>
#include <cstdlib>
#include <exception>
#include <filesystem>
#include <fstream>
Expand All @@ -11,7 +10,9 @@

#include "nlohmann/json.hpp"

#ifndef VOICEVOX_CORE_EXPORTS
#define VOICEVOX_CORE_EXPORTS
#endif // VOICEVOX_CORE_EXPORTS
Yosshi999 marked this conversation as resolved.
Show resolved Hide resolved
#include "core.h"

#define NOT_INITIALIZED_ERR "Call initialize() first."
Expand Down
2 changes: 1 addition & 1 deletion core/src/engine.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <cstdlib>
#include <exception>
#include <memory>
#include <stdexcept>
#include <vector>

#include "core.h"
Expand Down
2 changes: 1 addition & 1 deletion core/src/engine/acoustic_feature_extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ std::vector<OjtPhoneme> OjtPhoneme::convert(std::vector<OjtPhoneme> phonemes) {
}
return phonemes;
}
}
} // namespace voicevox::core::engine
4 changes: 1 addition & 3 deletions core/src/engine/acoustic_feature_extractor.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#pragma once

#include <iterator>
#include <map>
#include <random>
#include <string>
#include <vector>

Expand Down Expand Up @@ -41,4 +39,4 @@ class OjtPhoneme {
long phoneme_id() const;
static std::vector<OjtPhoneme> convert(std::vector<OjtPhoneme> phonemes);
};
}
} // namespace voicevox::core::engine
4 changes: 4 additions & 0 deletions core/src/engine/full_context_label.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "full_context_label.h"

#include <algorithm>
#include <iostream>
#include <iterator>
#include <regex>
#include <stdexcept>

namespace voicevox::core::engine {
std::string string_feature_by_regex(std::string pattern, std::string label) {
Expand Down
5 changes: 4 additions & 1 deletion core/src/engine/kana_parser.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#include "kana_parser.h"

#include <algorithm>
#include <optional>
#include <stdexcept>

#include "mora_list.h"

namespace voicevox::core::engine {
static const std::map<std::string, MoraModel> text2mora_with_unvoice() {
std::map<std::string, MoraModel> text2mora_with_unvoice;
Expand Down Expand Up @@ -160,4 +163,4 @@ std::string create_kana(std::vector<AccentPhraseModel> accent_phrases) {
}
return text;
}
}
} // namespace voicevox::core::engine
3 changes: 1 addition & 2 deletions core/src/engine/kana_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <vector>

#include "model.h"
#include "mora_list.h"

namespace voicevox::core::engine {
const int LOOP_LIMIT = 300;
Expand All @@ -20,4 +19,4 @@ static const std::map<std::string, MoraModel> text2mora_with_unvoice();
AccentPhraseModel text_to_accent_phrase(std::string phrase);
std::vector<AccentPhraseModel> parse_kana(std::string text);
std::string create_kana(std::vector<AccentPhraseModel> accent_phrases);
}
} // namespace voicevox::core::engine
2 changes: 1 addition & 1 deletion core/src/engine/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ struct AudioQueryModel {
bool output_stereo;
std::string kana;
};
}
} // namespace voicevox::core::engine
2 changes: 1 addition & 1 deletion core/src/engine/mora_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ std::string mora2text(std::string mora) {
}
return text;
}
}
} // namespace voicevox::core::engine
2 changes: 1 addition & 1 deletion core/src/engine/mora_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@ static const std::vector<std::string> mora_list_minimum = {
// clang-format on

std::string mora2text(std::string mora);
}
} // namespace voicevox::core::engine
4 changes: 3 additions & 1 deletion core/src/engine/openjtalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <njd_set_unvoiced_vowel.h>
#include <text2mecab.h>

#include <stdexcept>

namespace voicevox::core::engine {
std::vector<std::string> OpenJTalk::extract_fullcontext(std::string text) {
char buff[8192];
Expand Down Expand Up @@ -53,4 +55,4 @@ void OpenJTalk::clear() {
NJD_clear(&njd);
JPCommon_clear(&jpcommon);
}
}
} // namespace voicevox::core::engine
3 changes: 1 addition & 2 deletions core/src/engine/openjtalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <mecab.h>
#include <njd.h>

#include <stdexcept>
#include <string>
#include <vector>

Expand All @@ -35,4 +34,4 @@ class OpenJTalk {
void load(const std::string& dn_mecab);
void clear();
};
}
} // namespace voicevox::core::engine
5 changes: 5 additions & 0 deletions core/src/engine/synthesis_engine.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#include "synthesis_engine.h"

#include <algorithm>
#include <cmath>
#include <iterator>
#include <optional>
#include <sstream>
#include <stdexcept>

#include "../core.h"
#include "full_context_label.h"
#include "mora_list.h"

Expand Down
2 changes: 0 additions & 2 deletions core/src/engine/synthesis_engine.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#pragma once

#include <memory>
#include <sstream>
#include <string>
#include <vector>

#include "../core.h"
#include "acoustic_feature_extractor.h"
#include "model.h"
#include "openjtalk.h"
Expand Down