Skip to content

Commit

Permalink
1.6.2 (#31)
Browse files Browse the repository at this point in the history
* Warn about nospeechxml conflict with pitch.
* Add cortana voice to selection list.
* Add more error checking. Fix assert on invalid output reclone.
* Add fxradio_nonoise.
* Add paragraph_pause. Rework text parsing and help.
* Add filters to effects.
  • Loading branch information
p-groarke authored Apr 16, 2024
1 parent 93f245a commit f9a915f
Show file tree
Hide file tree
Showing 14 changed files with 1,254 additions and 870 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_policy(SET CMP0091 NEW)
cmake_minimum_required (VERSION 3.15)
project(wsay VERSION 1.6.1 LANGUAGES CXX)
project(wsay VERSION 1.6.2 LANGUAGES CXX)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
Expand Down Expand Up @@ -116,7 +116,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_COMMAND_ARGUMENTS "

# Tests
if (WSAY_TESTS)
enable_testing()
# enable_testing()

find_package(GTest CONFIG REQUIRED)

Expand All @@ -125,7 +125,7 @@ if (WSAY_TESTS)
add_executable(${TEST_NAME} ${TEST_SOURCES})
target_link_libraries(${TEST_NAME} PRIVATE ${LIB_NAME} GTest::GTest)

gtest_discover_tests(${TEST_NAME})
# gtest_discover_tests(${TEST_NAME})
add_dependencies(${TEST_NAME} ${PROJECT_NAME})

fea_set_compile_options(${TEST_NAME} PUBLIC)
Expand Down
4 changes: 2 additions & 2 deletions libinclude/wsay/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <string>
#include <vector>

namespace wsy {
namespace wsay {
struct async_token_imp;
struct async_token : fea::pimpl_ptr<async_token_imp> {
async_token();
Expand Down Expand Up @@ -88,4 +88,4 @@ struct engine : fea::pimpl_ptr<engine_imp> {
engine_imp& imp();
};

} // namespace wsy
} // namespace wsay
36 changes: 20 additions & 16 deletions libinclude/wsay/voice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@
#include <limits>
#include <vector>

namespace wsy {
enum class effect_e : uint8_t {
namespace wsay {
enum class radio_preset_e : uint8_t {
radio1,
radio2,
radio3,
radio4,
radio5,
radio6,
radiocount,
count = radiocount,
count,
};

enum class compression_e : uint8_t {
Expand Down Expand Up @@ -87,21 +86,23 @@ struct voice {
uint8_t speed = 50; // 0-100
uint8_t pitch = 10; // 0-20
bool xml_parse = true;
bool radio_effect_disable_whitenoise = false;
uint16_t paragraph_pause_ms = (std::numeric_limits<uint16_t>::max)();
size_t voice_idx = 0;

void effect(effect_e fx) {
_effect = fx;
void radio_effect(radio_preset_e fx) {
_radio_effect = fx;
_compression = compression_e::none;
_bit_depth = bit_depth_e::_16;
_sampling_rate = sampling_rate_e::_44;
}
effect_e effect() const {
return _effect;
radio_preset_e radio_effect() const {
return _radio_effect;
}

void compression(compression_e comp) {
assert(comp != compression_e::count);
_effect = effect_e::count;
_radio_effect = radio_preset_e::count;
_compression = comp;
}
compression_e compression() const {
Expand All @@ -110,7 +111,7 @@ struct voice {

void bit_depth(bit_depth_e bd) {
assert(bd != bit_depth_e::count);
_effect = effect_e::count;
_radio_effect = radio_preset_e::count;
_bit_depth = bd;
}
bit_depth_e bit_depth() const {
Expand All @@ -119,7 +120,7 @@ struct voice {

void sampling_rate(sampling_rate_e sr) {
assert(sr != sampling_rate_e::count);
_effect = effect_e::count;
_radio_effect = radio_preset_e::count;
_sampling_rate = sr;
}
sampling_rate_e sampling_rate() const {
Expand All @@ -146,17 +147,20 @@ struct voice {
}

private:
// friend struct engine;
effect_e _effect = effect_e::count; // if set, supersedes audio settings.
// If set, supersedes audio settings.
radio_preset_e _radio_effect = radio_preset_e::count;

// Audio settings.
compression_e _compression = compression_e::none;
bit_depth_e _bit_depth = bit_depth_e::_16;
sampling_rate_e _sampling_rate = sampling_rate_e::_44;

// Audio outputs.
std::vector<voice_output> _outputs;
};

inline constexpr size_t num_radio_fx() {
return size_t(effect_e::radiocount) - size_t(effect_e::radio1);
inline constexpr size_t radio_preset_count() {
return size_t(radio_preset_e::count);
}

} // namespace wsy
} // namespace wsay
Loading

0 comments on commit f9a915f

Please sign in to comment.