Skip to content

Commit

Permalink
Modify
Browse files Browse the repository at this point in the history
  • Loading branch information
fugashy committed Jun 19, 2024
1 parent e63a455 commit a09b8ca
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
9 changes: 9 additions & 0 deletions include/voicevox_client_cpp/voicevox_client_cpp.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef VOICEVOX_CLIENT_CPP_HPP_
#define VOICEVOX_CLIENT_CPP_HPP_

#include "voicevox_client_cpp/client.hpp"
#include "voicevox_client_cpp/get.hpp"
#include "voicevox_client_cpp/request.hpp"
#include "voicevox_client_cpp/post.hpp"

#endif // VOICEVOX_CLIENT_CPP_HPP_
8 changes: 4 additions & 4 deletions src/voicevox_client_cpp/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pplx::task<void> Client::Request(
{
if (res.status_code() != web::http::status_codes::OK)
{
std::cerr << "Unexpected status code" << std::endl;
std::cerr << "[voicevox] Unexpected status code" << std::endl;
callback(std::nullopt);
return;
}
Expand All @@ -70,7 +70,7 @@ pplx::task<void> Client::Request(
}
else
{
std::cerr << "Unknown content type: " << content_type << std::endl;
std::cerr << "[voicevox] Unknown content type: " << content_type << std::endl;
callback(web::json::value());
}
});
Expand Down Expand Up @@ -118,13 +118,13 @@ pplx::task<void> Client::Request(
{
if (res.status_code() != web::http::status_codes::OK)
{
std::cerr << "Unexpected status code" << std::endl;
std::cerr << "[voicevox] Unexpected status code" << std::endl;
return std::vector<unsigned char>();
}
const auto content_type = res.headers().content_type();
if (content_type != "audio/wav")
{
std::cerr << "Unexpected content type: " << content_type << std::endl;
std::cerr << "[voicevox] Unexpected content type: " << content_type << std::endl;
return std::vector<unsigned char>();
}
auto vector_task = res.extract_vector();
Expand Down
3 changes: 1 addition & 2 deletions src/voicevox_client_cpp/sample/get_core_versions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "voicevox_client_cpp/client.hpp"
#include "voicevox_client_cpp/get.hpp"
#include "voicevox_client_cpp/voicevox_client_cpp.hpp"

#include <iostream>

Expand Down
3 changes: 1 addition & 2 deletions src/voicevox_client_cpp/sample/get_speakers.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "voicevox_client_cpp/client.hpp"
#include "voicevox_client_cpp/get.hpp"
#include "voicevox_client_cpp/voicevox_client_cpp.hpp"

#include <iostream>

Expand Down
3 changes: 1 addition & 2 deletions src/voicevox_client_cpp/sample/get_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "voicevox_client_cpp/client.hpp"
#include "voicevox_client_cpp/get.hpp"
#include "voicevox_client_cpp/voicevox_client_cpp.hpp"

#include <iostream>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "voicevox_client_cpp/client.hpp"
#include "voicevox_client_cpp/post.hpp"
#include "voicevox_client_cpp/voicevox_client_cpp.hpp"

#include <iostream>

Expand Down Expand Up @@ -37,6 +36,7 @@ void RequestSynthesis(const voicevox_client_cpp::Client::OptionalJson& json)
task.wait();
}


int main(int argc, char** argv)
{
// default text to synthesis
Expand Down

0 comments on commit a09b8ca

Please sign in to comment.