RU_TTS_TRANSFER(3)
β¨ NAME β¨
okay bestie, welcome to the RU_TTS_TRANSFER(3) manual page π
ru_tts_transfer β transfer specified Russian text to speech π£οΈπ·πΊβ¨
πΈ SYNOPSIS πΈ
#include <ru_tts.h>
typedef int (*ru_tts_callback)(void *buffer, size_t size, void *user_data);
void ru_tts_transfer(ru_tts_conf_t *config, char *text, void *wave_buffer, size_t wave_buffer_size, ru_tts_callback wave_consumer, void *user_data);
void ru_tts_config_init(ru_tts_conf_t *config);
π DESCRIPTION π
so ru_tts_transfer() takes the text that text is pointing at and turns it into digitized sound in the raw linear signed 8-bit 10 kHz format. no cap, that's the format. π§
that source text has to be a zero-terminated string holding Russian text in koi8-r charset. and here's the cute part β the symbols '+' and '=' sitting right after a vowel mean strong stress and weak stress respectively. it's giving diacritics but make it ASCII π
the resulting data gets fed to the callback function referenced by the wave_consumer argument, chunk by chunk, through the buffer you specify with wave_buffer and wave_buffer_size. and the user_data argument gets passed to the callback as a pointer to whatever extra data you the user specified. it's literally your lil goodie bag π
you can pass all kinds of speech synthesis control options through the ru_tts_conf_t data structure pointed at by the config argument, and it holds these fields:
typedef struct {
int speech_rate;
int voice_pitch;
int intonation;
int general_gap_factor;
int comma_gap_factor;
int dot_gap_factor;
int semicolon_gap_factor;
int colon_gap_factor;
int question_gap_factor;
int exclamation_gap_factor;
int intonational_gap_factor;
int flags;
} ru_tts_conf_t;
this structure needs to be initialized by the ru_tts_config_init() function, which fills it with the default values. she's your starter pack, bestie β¨
okay so about the numbers β all numeric values are a percentage of the corresponding parameter's normal level. initially they're all set to 100. every parameter has its own reasonable value range, but ngl, out-of-range values don't cause any problem at all, because they just get treated as the nearest boundary of the acceptable range. so she's forgiving π
speech_rateβ speech rate in percents of the normal level. reasonable value range is from20up to500. πββοΈvoice_pitchβ voice pitch in percents of the normal level. reasonable value range is from50up to300. π΅intonationβ voice pitch variation range. it can vary from0(absolutely monotonic speech, like, zero drama) up to140(a bit more expressive than normal). πgeneral_gap_factorβ percentage factor applied to all interclause gaps. its lower boundary is0, which means no gaps at all. the maximum proportionally depends on the speech rate. on normal rate it's approximately312. βΈοΈcomma_gap_factorβ relative duration of the gap implied by comma encountering. reasonable value range is from0up to750.,dot_gap_factorβ relative duration of the gap implied by dot encountering. reasonable value range is from0up to500..semicolon_gap_factorβ relative duration of the gap implied by semicolon encountering. reasonable value range is from0up to600.;colon_gap_factorβ relative duration of the gap implied by colon encountering. reasonable value range is from0up to600.:question_gap_factorβ relative duration of the gap implied by question mark encountering. reasonable value range is from0up to375.?exclamation_gap_factorβ relative duration of the gap implied by exclamation mark encountering. reasonable value range is from0up to300.!intonational_gap_factorβ relative duration of purely intonational gaps not caused by a punctuation. reasonable value range is from0up to1000. π«§flagsβ additional flags. the following flag constants, bitwise-or'd together, may be used here. πDEC_SEP_POINTβ treat point inside a number as decimal separator. initially this flag is set. βDEC_SEP_COMMAβ treat comma inside a number as decimal separator. initially this flag is set. βUSE_ALTERNATIVE_VOICEβ use alternative (female) voice instead of the default (male) one. initially this flag is not set. π
it is suggested that the user provided callback function takes further responsibility on the generated data. it may play it immediately or store it somewhere or do whatever it is designed for. πΎπΆ
this function should return 0 in usual circumstances. a non-zero return value causes immediate transfer stop. π so like, be careful bestie, that's the brakes π
π«Ά AUTHOR π«Ά
Igor B. Poretsky <poretsky@mlbox.ru>. π
and that's the whole page, fr fr π¦ this one was dated January 11, 2023, and it's the RU_TTS_TRANSFER(3) page from the Library Functions Manual β love her, read her, slay her π
β¨π
π¦ where this page comes from
- debian trixie: librutts-dev 6.2.3-1+b1 Β· MIT
- ubuntu questing: librutts-dev 6.2.3-1
- ubuntu resolute: librutts-dev 6.2.3-1build1 Β· MIT
- ubuntu stonking: librutts-dev 6.2.3-1build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms