RU_TTS_TRANSFER(3)

NAME
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(char *text, void *wave_buffer, size_t wave_buffer_size, ru_tts_callback wave_consumer, void *user_data, int voice, int rate, int pitch, int intonation);

DESCRIPTION
The ru_tts_transfer() function transfers text pointed by text argument into digitized sound in the raw linear signed 8-bit 10 kHz format. The source text should be represented by zero-terminated string containing Russian text in koi8-r charset. The resulting data are fed to the callback function referenced by wave_consumer argument chunk by chunk via buffer specified by wave_buffer and wave_buffer_size arguments. The user_data argument is passed to the callback as a pointer to any additional data specified by user.

The other arguments specify various speech parameters. if voice is non-zero, the alternative voice will be used instead of the default one. The reasonable values of rate and pitch are from 0 through 250. All other values are reduced to this interval. The greater rate value implies faster speech. The greater value of pitch causes higher pitched voice. The argument intonation is treated as a boolean value. If it is zero the produced speech will be monotone.

It is suggested that the user provided callback function takes further responsibility on the generated data. It may play it immediately or store somewhere or do whatever it is designed for. This function should return 0 in usual circumstances. Non-zero return value causes immediate transfer stop.

AUTHOR
Igor B. Poretsky <poretsky@mlbox.ru>.