### MBROLA Piping Example for Speaking Clock Source: https://github.com/numediart/mbrola/blob/master/README.md Illustrates a typical piping setup for a speaking clock application using MBROLA to generate audio output. ```bash speaking_clock | mbrola - -.au | splayer ``` -------------------------------- ### MBROLA Phoneme Input Format Example Source: https://github.com/numediart/mbrola/blob/master/README.md This is an example of the .pho file format, showing phoneme names, durations, and pitch targets. ```plaintext ; bonjour _ 51 25 114 b 62 o~ 127 48 170.42 Z 110 53.5 116 u 211 R 150 50 91 _ 91 ``` -------------------------------- ### MBROLA initialization file example Source: https://github.com/numediart/mbrola/blob/master/README.md Demonstrates how to use an initialization file to set various voice synthesis parameters like TIME, FREQ, and VOICE. ```text TIME 1.2 FREQ 0.8 ``` -------------------------------- ### Setting voice frequency in initialization file Source: https://github.com/numediart/mbrola/blob/master/README.md Example of setting the voice frequency parameter using the 'VOICE' command in an initialization file. ```text VOICE 10000 ``` -------------------------------- ### Custom CFLAGS Example for Sun Station Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Example of setting CFLAGS for optimized compilation on a Sun Station, including common flags and the BIG_ENDIAN definition. ```makefile CFLAGS= -Wall -DBIG_ENDIAN -O6 ``` -------------------------------- ### Install MBROLA Executable Source: https://github.com/numediart/mbrola/blob/master/README.md Copies the compiled MBROLA executable to the standard /usr/bin directory, making it accessible system-wide by its name. ```bash sudo cp Bin/mbrola /usr/bin/mbrola ``` -------------------------------- ### Fifo Public Member Access Example Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Example demonstrating how to access Fifo members using the defined macros. This illustrates the encapsulation principle where members are accessed indirectly. ```c Fifo* my_fifo; �.. int length= buffer_size(my_fifo); ``` -------------------------------- ### Install Compilation Dependencies on Debian-based Linux Source: https://github.com/numediart/mbrola/blob/master/README.md Installs the make and gcc packages required for compiling the MBROLA project on Debian-based Linux systems. ```bash sudo apt-get install make gcc ``` -------------------------------- ### Setting flush command in initialization file Source: https://github.com/numediart/mbrola/blob/master/README.md Example of setting a custom flush command symbol using the 'FLUSH' command in an initialization file. ```text FLUSH FLUSH_COMMAND ``` -------------------------------- ### Compile MBROLA Project Source: https://github.com/numediart/mbrola/blob/master/README.md Compiles the MBROLA project using the make utility. Ensure you have the necessary C compiler and libraries installed. ```bash make ``` -------------------------------- ### MBROLA command-line usage example Source: https://github.com/numediart/mbrola/blob/master/README.md Illustrates the general syntax for using MBROLA, specifying input phonetic files and an output audio file. The output file extension determines the audio format. ```bash USAGE: mbrola [COMMAND LINE OPTIONS] database pho_file+ output_file A - instead of pho_file or output_file means stdin or stdout Extension of output_file ( raw, au, wav, aiff ) tells the wanted audio format Options can be any of the following: -i = display the database information if any -e = IGNORE fatal errors on unknown diphone -c CC = set COMMENT char (escape sequence in pho files) -F FC = set FLUSH command name -v VR = VOLUME ratio, float ratio applied to ouput samples -f FR = FREQ ratio, float ratio applied to pitch points -t TR = TIME ratio, float ratio applied to phone durations -l VF = VOICE freq, target freq for voice quality -R RL = Phoneme RENAME list of the form a A b B ... -C CL = Phoneme CLONE list of the form a A b B ... -I IF = Initialization file containing one command per line CLONE, RENAME, VOICE, TIME, FREQ, VOLUME, FLUSH, COMMENT, and IGNORE are available -W = store the database in ROM format -w = the database in a ROM dump -d = Show list of diphones in the database ``` -------------------------------- ### Get Version Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the MBROLA library version string. ```c int DLL_EXPORT getVersion_MBR2(char *msg,int nb_wanted); ``` -------------------------------- ### MBROLA Synth Command Usage Example Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Generates a WAV audio file for the French word 'bonjour' using the FR1 MBROLA database. ```bash synth fr1/fr1 fr1/TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### Generate WAV from Phoneme File Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html A command-line example demonstrating how to use the 'synth' command to convert a phonetic input file (.pho) into a WAV audio file. ```bash synth fr1/fr1 bonjour.pho bonjour.wav ``` -------------------------------- ### Custom CFLAGS Example for Debug Mode on VAX/VMS Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Example of setting CFLAGS for debug mode on a VAX/VMS system, including flags for debugging, endianness, and VMS environment. ```makefile CFLAGS= -Wall -DLITTLE_ENDIAN -DVMS -g -DDEBUG ``` -------------------------------- ### Get Volume Ratio Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the current overall volume ratio setting. ```c float DLL_EXPORT get_volume_ratio_MBR2(Mbrola* mb); ``` -------------------------------- ### MBROLA Get Volume Ratio Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the current overall volume ratio setting. ```c float get_volume_ratio_Mbrola(Mbrola* mb); ``` -------------------------------- ### Basic MBROLA Usage on MS-DOS/Windows Source: https://github.com/numediart/mbrola/blob/master/README.md Standard command-line invocation for MBROLA on MS-DOS or Windows systems. This example synthesizes speech from a .pho file to a .wav file. ```bash mbrola fr1/fr1 TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### Get Spectral Smoothing Setting Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the current spectral smoothing setting for MBROLA synthesis. ```c int DLL_EXPORT getSmoothing_MBR2(Mbrola* mb); ``` -------------------------------- ### Adjust output volume with MBROLA Source: https://github.com/numediart/mbrola/blob/master/README.md Employ the '-v' option to control the output volume by multiplying each sample by a specified ratio. This example reduces the loudness. ```bash mbrola -v 0.7 fr1/fr1 TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### Playing Audio with DECSOUND on VAX/AXP Source: https://github.com/numediart/mbrola/blob/master/README.md Example of playing an audio file using the DECSOUND device on VAX or AXP workstations after setting up MBROLA environment variables. ```dcl $ MCR DECSOUND - volume 40 -play sound.au ``` -------------------------------- ### Get MBROLA command-line help Source: https://github.com/numediart/mbrola/blob/master/README.md Use the '-h' flag with the 'mbrola' command to access help information. This provides a detailed overview of available commands and their usage. ```bash mbrola -h ``` -------------------------------- ### Define MBROLA Directory on VAX/AXP Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Sets an environment variable to point to the MBROLA installation directory. This is typically added to system startup procedures. ```dcl $ DEFINE/SYSTEM/EXEC MBROLA_DIR disk:[dir] ``` -------------------------------- ### Build Demo for lib1 Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to build a demonstration program that exemplifies the usage of lib1. ```bash "make demo1" ``` -------------------------------- ### Sending USR1 Signal to MBROLA Process Source: https://github.com/numediart/mbrola/blob/master/README.md Example of sending a USR1 signal to a running MBROLA process to interrupt audio output, typically used in piping scenarios. ```bash kill -SIGUSR1 mbrola_process_number ``` -------------------------------- ### Build Demo for lib2 Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to build a demonstration program that exemplifies the usage of lib2. ```bash "make demo2" ``` -------------------------------- ### Parser Simple C Implementation Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html A C implementation of a simple parser that reads phonetic inputs from a text file. It defines functions for resetting, getting the next phone, and closing the parser. ```C /* * FPMs-TCTS SOFTWARE LIBRARY * * File: parser_simple.c * Purpose: parse a simple "pho file" (demonstration of the mbrola DLL) * Instanciation of parser.h * * Author: Vincent Pagel * Email : mbrola@tcts.fpms.ac.be * * Copyright (c) 1995-2018 Faculte Polytechnique de Mons (TCTS lab) * * 18/09/98 : Created */ #include #include "mbrola.h" #include "parser_simple.h" static void reset_ParserSimple(Parser* parse) { /* nothing to do */ fseek( (File*) parse->self,0,SEEK_SET); } static StatePhone nextphone_ParserSimple(Parser* parse, LPPHONE* ph) { char phoneme[255]; /* phoneme name */ float length; /* length in milliseconds */ float pitch0; /* pitch at 0% */ float pitch100; /* pitch at 100% */ if ( fscanf( (FILE*)parse->self," %s %f %f %f ",phoneme,&length,&pitch0,&pitch100 ) ==4 ) { *ph= init_Phone(phoneme,length); appendf0_Phone(*ph, 0.0 , pitch0); appendf0_Phone(*ph, 100.0, pitch100); return PHO_OK; } else { return PHO_EOF; } } static void close_ParserSimple(Parser* parse) /* Destructor */ { fclose( (FILE*) parse->self); free(parse); } Parser* init_ParserSimple(char* input_name) /* * Constructor of the parser. Parse a text file of the form * PHONEME LENGTH PITCH_AT_BEGINNING PITCH_AT_END */ { FILE* input; Parser* parse; /* open the text file */ input=fopen(input_name,"rt"); if (!input) return NULL; parse= (Parser*) MBR_alloc( sizeof( struct Parser) ); parse->reset_Parser= reset_ParserSimple; parse->close_Parser= close_ParserSimple; parse->nextphone_Parser= nextphone_ParserSimple; parse->self= (void*) input; return(parse); } ``` -------------------------------- ### Generic Database Initialization (Old Method) Source: https://github.com/numediart/mbrola/blob/master/Documentation/rom_documentation.txt This is the previous method for initializing a database by providing a file name. The database header determined its type. ```c Database* init_Database(char* dbaname); /* Generic initialization, calls the appropriate constructor * Returning NULL means fail (check LastError) */ ``` -------------------------------- ### Multi-Channel Synthesis Functions Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Functions for initializing, configuring, and managing multi-channel speech synthesis using MBROLA. These functions handle database initialization, copying, closing, and engine setup for concurrent synthesis streams. ```APIDOC ## init_DatabaseMBR2 ### Description Initializes a multi-channel MBROLA database, allowing for renaming or cloning of phoneme names. ### Method `Database* init_DatabaseMBR2(char* dbaname, char* rename, char* clone)` ### Parameters #### Path Parameters - **dbaname** (char*) - The name of the file containing the database. - **rename** (char*) - Optional. Parameters to rename phoneme names. `NULL` means no modification. - **clone** (char*) - Optional. Parameters to clone phoneme names. `NULL` means no modification. ### Returns - A pointer to the initialized `Database` object, or `NULL` on error. ``` ```APIDOC ## copyconstructor_DatabaseMBR2 ### Description Creates a copy of a diphone database. This is highly recommended for multi-channel synthesis to allow multiple synthesis engines to use the same database concurrently without interfering with each other. ### Method `Database* copyconstructor_DatabaseMBR2(Database* dba)` ### Parameters #### Path Parameters - **dba** (Database*) - A pointer to the database to copy. ### Returns - A pointer to the copied `Database` object. ``` ```APIDOC ## close_DatabaseMBR2 ### Description Releases the memory associated with a multi-channel MBROLA database. ### Method `void close_DatabaseMBR2(Database* dba)` ### Parameters #### Path Parameters - **dba** (Database*) - A pointer to the database to close. ``` ```APIDOC ## close_ParserMBR2 ### Description Releases the memory of a polymorphic parser used in multi-channel synthesis. ### Method `void close_ParserMBR2(Parser* pars)` ### Parameters #### Path Parameters - **pars** (Parser*) - A pointer to the parser to close. ``` ```APIDOC ## init_MBR2 ### Description Initializes the multi-channel MBROLA synthesis engine. ### Method `Mbrola* init_MBR2(Database* db, Parser* parse)` ### Parameters #### Path Parameters - **db** (Database*) - A pointer to the initialized database. - **parse** (Parser*) - A pointer to the parser to be used. ### Returns - A pointer to the initialized `Mbrola` engine, or `NULL` if initialization fails. ``` ```APIDOC ## close_MBR2 ### Description Frees all resources associated with a multi-channel MBROLA synthesis engine. ### Method `void close_MBR2(Mbrola* mb)` ### Parameters #### Path Parameters - **mb** (Mbrola*) - A pointer to the `Mbrola` engine to close. ``` ```APIDOC ## reset_MBR2 ### Description Resets the internal audio buffer of the multi-channel engine, useful for flushing or handling interruptions. ### Method `int reset_MBR2(Mbrola* mb)` ### Parameters #### Path Parameters - **mb** (Mbrola*) - A pointer to the `Mbrola` engine. ### Returns - `true` if successful, `false` in case of failure. ``` ```APIDOC ## readtype_MBR2 ### Description Reads a specified number of samples from an audio buffer with a given sample type for the multi-channel engine. ### Method `int readtype_MBR2(Mbrola* mb, void *buffer_out, int nb_wanted, AudioType sample_type)` ### Parameters #### Path Parameters - **mb** (Mbrola*) - A pointer to the `Mbrola` engine. - **buffer_out** (void *) - Output buffer to store the audio samples. - **nb_wanted** (int) - The number of samples to read. - **sample_type** (AudioType) - The type of audio samples (e.g., LIN16, LIN8, ULAW, ALAW). ### Returns - The effective number of samples read. ``` ```APIDOC ## getDatabaseInfo_MBR2 ### Description Retrieves information about the loaded database for the multi-channel engine. ### Method `int getDatabaseInfo_MBR2(Mbrola* mb, char *msg, int nb_wanted, int index)` ### Parameters #### Path Parameters - **mb** (Mbrola*) - A pointer to the `Mbrola` engine. - **msg** (char *) - Buffer to store the information message. - **nb_wanted** (int) - The maximum number of bytes to retrieve. - **index** (int) - The index of the information message to retrieve. If `NULL`, it retrieves the size. ### Returns - The number of bytes written to `msg`, or a negative error code. ``` ```APIDOC ## setFreq_MBR2 ### Description Sets the output frequency for the multi-channel synthesis engine. ### Method `void setFreq_MBR2(Mbrola* mb, int freq)` ### Parameters #### Path Parameters - **mb** (Mbrola*) - A pointer to the `Mbrola` engine. - **freq** (int) - The desired output frequency. ``` ```APIDOC ## getFreq_MBR2 ### Description Returns the current output frequency of the multi-channel synthesis engine. ### Method `int getFreq_MBR2(Mbrola* mb)` ### Parameters #### Path Parameters - **mb** (Mbrola*) - A pointer to the `Mbrola` engine. ### Returns - The current output frequency. ``` ```APIDOC ## setSmoothing_MBR2 ### Description Enables or disables spectral smoothing for the multi-channel synthesis engine. ### Method `void setSmoothing_MBR2(Mbrola* mb, int smoothing)` ### Parameters #### Path Parameters - **mb** (Mbrola*) - A pointer to the `Mbrola` engine. - **smoothing** (int) - `1` to enable spectral smoothing, `0` to disable. ``` -------------------------------- ### Setting volume in initialization file Source: https://github.com/numediart/mbrola/blob/master/README.md Demonstrates how to set the output volume using the 'VOLUME' command within an initialization file. ```text VOLUME 0.7 ``` -------------------------------- ### Initialize MBROLA Database Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a diphone database from the specified file. Returns a pointer to the Database structure or NULL on failure. ```c Database* init_Database(char* dbaname); ``` -------------------------------- ### Get No Error Flag Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the current setting for suppressing error messages. ```c int DLL_EXPORT get_no_error_MBR2(Mbrola* mb); ``` -------------------------------- ### Initialize MBR2 Database Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes an MBR2 database from a file path. Error handling is included to check if the database was successfully opened. ```C Database* main_dba= init_DatabaseMBR2(argv[1],NULL,NULL); if (!main_dba) handle_error(True); ``` -------------------------------- ### MBROLA Get Smoothing Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Checks if the spectral smoothing algorithm is currently enabled. ```c bool get_smoothing_Mbrola(Mbrola* mb); ``` -------------------------------- ### MBROLA Get Voice Frequency Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the current output frequency of the audio. ```c uint16 get_voicefreq_Mbrola(Mbrola* mb); ``` -------------------------------- ### Initialize MBROLA Database with Renaming Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a diphone database with optional phoneme renaming and cloning. Returns NULL on failure. ```c Database* init_rename_Database(char* dbaname, RenameList* rename, RenameList* clone); ``` -------------------------------- ### Get Output Frequency from Single-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Returns the current output frequency of the synthesizer. ```c int DLL_EXPORT getFreq_MBR(); ``` -------------------------------- ### Initialize Database from ROM Image Source: https://github.com/numediart/mbrola/blob/master/Documentation/rom_documentation.txt The new mechanism for initializing a database using a pointer to a ROM image. This method is more memory-efficient as it keeps data in ROM. ```c Database* init_ROM_Database(void* input_ptr); /* * Initialize a database from a ROM image */ ``` -------------------------------- ### MBROLA Synth Command Help Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Displays the help screen for the MBROLA standalone 'synth' command, outlining its usage and available command-line options. ```bash synth -h ``` -------------------------------- ### MBROLA Get No Error Tolerance Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the current setting for tolerance to missing diphones. ```c bool get_no_error_Mbrola(Mbrola* mb); ``` -------------------------------- ### Get Last Error Message Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the error message string for the last MBROLA error. ```c int DLL_EXPORT lastErrorStr_MBR2(char *buffer_err,int nb_wanted); ``` -------------------------------- ### Run MBROLA to view terms and conditions Source: https://github.com/numediart/mbrola/blob/master/README.md Execute the 'mbrola' command without arguments to display the terms and conditions for using the software. This is the first step before using any other MBROLA functionalities. ```bash mbrola ``` -------------------------------- ### Get Last Error Code Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the error code of the last operation performed by MBROLA. ```c int DLL_EXPORT lastError_MBR2(); ``` -------------------------------- ### Get Volume Ratio from Single-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Returns the current overall volume ratio of the synthesizer. ```c float DLL_EXPORT getVolumeRatio_MBR(); ``` -------------------------------- ### Get No Error Tolerance from Single-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Returns the current setting for tolerance to missing diphones. ```c int DLL_EXPORT getNoError_MBR(); ``` -------------------------------- ### Get Output Frequency from Multi-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Returns the current output frequency of the multi-channel MBROLA synthesizer. ```c int DLL_EXPORT getFreq_MBR2(Mbrola* mb); ``` -------------------------------- ### Initialize Multi-Channel MBROLA Synthesizer Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes the multi-channel MBROLA synthesizer engine with a database and parser. Returns a pointer to the Mbrola structure or NULL on error. ```c Mbrola* DLL_EXPORT init_MBR2(Database* db, Parser* parse); ``` -------------------------------- ### Get Last Error Code from Single-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Returns the last error code encountered by the MBROLA synthesizer. ```c int DLL_EXPORT lastError_MBR(); ``` -------------------------------- ### Enable ROM Database Initialization Source: https://github.com/numediart/mbrola/blob/master/Documentation/rom_documentation.txt Compiler flag to enable the initialization of a Database from a ROM image using `init_ROM_Database`. This is typically commented out by default and should be uncommented if needed. ```makefile # Uncomment if you wish to use init_ROM_Database(ROM_pointer) CFLAGS += -DROMDATABASE_INIT ``` -------------------------------- ### Get MBROLA Version Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the release number of the MBROLA synthesizer into a provided buffer. nb_wanted specifies the buffer size. ```c int DLL_EXPORT getVersion_MBR(char *msg,int nb_wanted); ``` -------------------------------- ### MBROLA Initialization and Configuration Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Functions for initializing, closing, and configuring the MBROLA engine, including setting voice frequency, smoothing, error handling, and volume. ```APIDOC ## MBROLA Initialization and Configuration ### `init_Mbrola(Database* dba)` Connects the database to the synthesis engine and initializes internal variables. The phonemic command stream can be set later using `set_parser_Mbrola`. ### `close_Mbrola(Mbrola* mb)` Closes related features and frees allocated memory. ### `reset_Mbrola(Mbrola* mb)` Gives initial values to `current_diphone`. This prepares for the first `NextDiphone` call, ensuring `cur_diph` and `prev_diph` are correctly initialized. Returns `False` in case of an error. ### `set_voicefreq_Mbrola(Mbrola* mb, uint16 OutFreq)` Changes the output frequency and `VoiceRatio` to modify the vocal tract characteristics. ### `get_voicefreq_Mbrola(Mbrola* mb)` Retrieves the current output frequency. ### `set_smoothing_Mbrola(Mbrola* mb, bool smoothing)` Enables or disables spectral smoothing. ### `get_smoothing_Mbrola(Mbrola* mb)` Returns the current state of spectral smoothing. ### `set_no_error_Mbrola(Mbrola* mb, bool no_error)` Sets the tolerance for missing diphones. ### `get_no_error_Mbrola(Mbrola* mb)` Returns the current setting for tolerance to missing diphones. ### `set_volume_ratio_Mbrola(Mbrola* mb, float volume_ratio)` Adjusts the overall volume of the synthesized speech. ### `get_volume_ratio_Mbrola(Mbrola* mb)` Retrieves the current overall volume ratio. ### `set_parser_Mbrola(Mbrola* mb, Parser* parser)` Replaces the current parser with a new one. ``` -------------------------------- ### Define Target Operating System Source: https://github.com/numediart/mbrola/blob/master/README_Makefile.md Set one of these preprocessor definitions to specify the target operating system for the build. ```makefile #define TARGET_OS_MAC #define TARGET_OS_DOS #define TARGET_OS_SUN4 #define TARGET_OS_VMS #define TARGET_OS_BEOS ``` -------------------------------- ### Compile Standalone Binary Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to generate the 'synth' binary in standalone mode. ```bash "make" or "make all" ``` -------------------------------- ### Initialize Old Format Diphone Database Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes an old format diphone database for compatibility with releases before 2.05. It utilizes RAW functions for processing. ```c Database* init_DatabaseOld(Database* dba); ``` -------------------------------- ### Flush Synthesis Buffer with Pipe Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Demonstrates piping audio output from MBROLA to a player, and how to use the '#' character (or a custom symbol defined by ';; FLUSH') to flush the synthesis buffer to avoid audio cutoff issues. ```bash speaking_clock | mbrola fr1 - -.au | splayer ``` -------------------------------- ### Initialize Synthesis Channel Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a synthesis channel using a cloned database and a parser. This sets up a connection for synthesizing speech. ```C Mbrola* channel1= init_MBR2(clone_dba1,parser1); Mbrola* channel2= init_MBR2(clone_dba2,parser2); Mbrola* channel3= init_MBR2(clone_dba3,parser3); ``` -------------------------------- ### Get Last Error String from Single-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the last error message into a provided buffer. nb_wanted specifies the buffer size. ```c int DLL_EXPORT lastErrorStr_MBR(char *buffer_err,int nb_wanted); ``` -------------------------------- ### Copy Constructor for Database Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Creates a copy of a diphone database, duplicating the file handler. Recommended for multichannel synthesis to ensure safe concurrent access. Returns NULL on failure. ```c Database* copyconstructor_Database(Database* dba); ``` -------------------------------- ### Get Database Info from Single-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the i-th info message from the database. If msg is NULL, it returns the size of the message buffer. ```c int DLL_EXPORT getDatabaseInfo_MBR(char *msg,int nb_wanted,int index); ``` -------------------------------- ### Generate WAV file with default settings (MSDOS) Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Generates a RIFF Wav file using default MBROLA settings on MSDOS systems. ```bash synth fr1/fr1 TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### Phoneme Renaming and Cloning Configuration File Source: https://github.com/numediart/mbrola/blob/master/README.md For long lists of renaming and cloning operations, use an initialization file with RENAME and CLONE directives. This format is more convenient than command-line options. ```text RENAME a my_a RENAME b my_b CLONE r r0 CLONE r r= ``` -------------------------------- ### Compile Multi-Channel Library Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to compile lib2.c in library mode for multi-channel synthesis. ```bash "make lib2" ``` -------------------------------- ### Phone Initialization with Size Function Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declares a function to initialize a Phone with a specified name, length, and number of pitch points. ```c Phone* DLL_EXPORT initSized_Phone(char* name, float length,int nb_pitch); ``` -------------------------------- ### Initialize MBROLA Engine Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes the MBROLA engine with a specified diphone database. Always check the return code for errors. Ensure a corresponding close_MBR() call is made. ```C err_code= init_MBR("h:/mbrola/database/fr1" ); if (err_code<0) handle_error(); ``` -------------------------------- ### Get Database Info from Multi-Channel MBROLA Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Retrieves the i-th info message from the multi-channel MBROLA database. If msg is NULL, it returns the size of the message buffer. ```c int DLL_EXPORT getDatabaseInfo_MBR2(Mbrola* mb,char *msg,int nb_wanted,int index); ``` -------------------------------- ### Build Emacs Tags Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to build Emacs popular tags, which aids in navigating the codebase. ```bash "make tags" ``` -------------------------------- ### Initialize Input Stream for Synthesizer Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes an Input stream structure, linking it to a Fifo. This prepares the input for the synthesizer, particularly in multi-channel configurations. ```C input1= init_InputFifo(fifo1); input2= init_InputFifo(fifo2); input3= init_InputFifo(fifo3); ``` -------------------------------- ### MBROLA Environment Variables on VAX/AXP Source: https://github.com/numediart/mbrola/blob/master/README.md On VAX or AXP workstations, define environment variables to locate MBROLA executables and related utilities. This setup simplifies running MBROLA and other tools. ```dcl $ DEFINE/SYSTEM/EXEC MBROLA_DIR disk:[dir] $ MBROLA :== $MBROLA_DIR:MBROLA.EXE $ RAW2SUN :== $MBROLA_DIR:RAW2SUN.EXE ``` -------------------------------- ### MBROLA Basic Database Initialization Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Provides a basic initialization function for the Database structure, which may be extended based on the specific database coding type. ```c Database* init_DatabaseBasic(Database* dba); /* * Initialisation and loading of Diphones -> depend on database Coding * Returning NULL means fail (check LastError) */ ``` -------------------------------- ### MBROLA Get Next Diphone Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Reads a phone from the phonetic command buffer and prepares the next diphone for synthesis. Returns status codes like PHO_EOF, PHO_FLUSH, PHO_OK, or PHO_ERROR. ```c StatePhone NextDiphone(Mbrola* mb); ``` -------------------------------- ### Initialize Single-Channel MBROLA Synthesizer Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a single-channel MBROLA synthesizer with a specified diphone database. Returns 0 on success, or an error code. ```c int DLL_EXPORT init_MBR(char *dbaname); ``` -------------------------------- ### Initialize MBROLA Input Structure Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes the Input structure for MBROLA, linking it to a Fifo and setting up callback functions for reading, closing, and resetting the input stream. ```C Input* init_InputFifo(Fifo* my_fifo) { Input* self= (Input*) MBR_malloc( sizeof(Input) ); self->self= (void*) my_fifo; self->readline_Input= readline_InputFifo; self->close_Input= close_InputFifo; self->reset_Input= reset_InputFifo; return self; } ``` -------------------------------- ### Set voice characteristics with MBROLA Source: https://github.com/numediart/mbrola/blob/master/README.md Use the '-l' option to change voice characteristics by adjusting the target frequency. This example simulates a shorter vocal tract, potentially creating a higher-pitched voice. ```bash mbrola -l 18000 fr1/fr1 TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### Initialize Multi-Channel MBROLA Database Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a multi-channel MBROLA database, allowing renaming or cloning of phoneme names. Returns a pointer to the Database structure or NULL on error. ```c Database* DLL_EXPORT init_DatabaseMBR2(char* dbaname, char* rename, char* clone); ``` -------------------------------- ### Adjust speech duration and pitch with MBROLA Source: https://github.com/numediart/mbrola/blob/master/README.md Utilize '-t' for time ratio (duration) and '-f' for frequency ratio (pitch) to modify speech characteristics. This example slows down the speech and lowers its pitch. ```bash mbrola -t 1.2 -f 0.8 fr1/fr1 TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### Setting comment character in initialization file Source: https://github.com/numediart/mbrola/blob/master/README.md Shows how to configure the comment character for .pho files using the 'COMMENT' command in an initialization file. ```text COMMENT ! ``` -------------------------------- ### Build Windows DLL Source: https://github.com/numediart/mbrola/blob/master/README_Makefile.md Define DLL to build a Windows Dynamic Link Library (DLL). ```makefile #define DLL ``` -------------------------------- ### Compile One-Channel Library Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to compile lib1.c in library mode for one-channel synthesis. ```bash "make lib1" ``` -------------------------------- ### Initialize Diphone Information Structure Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Allocates memory and initializes a DiphoneInfo structure with the provided left and right phoneme names. ```c DiphoneInfo* init_DiphoneInfo(char* left, char* right); ``` -------------------------------- ### MBROLA Initialization Function Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes the MBROLA synthesis engine by connecting to a database and setting up internal variables. The phonemic command stream is connected later using set_parser_Mbrola. ```c Mbrola* init_Mbrola(Database* dba); ``` -------------------------------- ### MBROLA Synth Command with Pitch and Time Adjustment Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Generates audio with adjusted pitch, time, and volume using command-line options. ```bash synth -t 1.2 -f 0.8 -v 0.7 fr1/fr1 TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### MBROLA Synth Command with Database Info Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Displays information about the phoneme set and copyright for a given MBROLA database. ```bash synth -i fr1/fr1 ``` -------------------------------- ### Build in Library Mode Source: https://github.com/numediart/mbrola/blob/master/README_Makefile.md Define LIBRARY to build MBROLA in library mode instead of standalone. ```makefile #define LIBRARY ``` -------------------------------- ### Initialize Parser Input Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a parser input with specified parameters. This is a foundational step before processing phonetic data. ```C parser3= init_ParserInput(input3,"_",120.0,";",1.0,1.0); ``` -------------------------------- ### Initialize and Configure Single-Channel MBROLA Synthesizer Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a single-channel MBROLA synthesizer, allowing renaming or cloning of phoneme names from the database. Returns 0 on success, or an error code. ```c int DLL_EXPORT init_rename_MBR(char *dbaname,char* rename,char* clone); ``` -------------------------------- ### Initialize and Clone Diphone Information Structure Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Allocates memory and initializes a DiphoneInfo structure, copying parameters from a source structure except for the left and right phoneme names. ```c DiphoneInfo* initclone_DiphoneInfo(DiphoneInfo* src, char* left, char* right); ``` -------------------------------- ### Use ROM Dump for Debugging Source: https://github.com/numediart/mbrola/blob/master/Documentation/rom_documentation.txt Command to use a ROM dump file with the standalone 'mbrola' program for debugging purposes. This initializes the engine with the ROM data. ```bash mbrola -w fr1 TEST/bonjour.pho output.wav ``` -------------------------------- ### Write Integer Samples to File Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declares a function to write a buffer of 16-bit integers to a file. This is used for saving audio data in a specific format. ```c int write_int16s(int16 *buffer,int count,FILE *file); ``` -------------------------------- ### Input File Initialization Function Declaration Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declaration for initializing an Input stream from a FILE pointer. ```c /\* * Purpose: input stream from a file handler * Author: Vincent Pagel *\/ Input* init_InputFile(FILE* my_file ); ``` -------------------------------- ### Phone Initialization Function Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declares a function to initialize a Phone with a name and length, defaulting to two pitch points. ```c Phone* DLL_EXPORT init_Phone(char* name, float length); ``` -------------------------------- ### MBROLA Database Index Loading Function Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Loads the index table of diphones from the database file and populates a hash table for efficient lookup. ```c bool ReadDatabaseIndex(Database* dba); /* * Read the index table of diphones, and put them in the hash table */ ``` -------------------------------- ### Enable Signal Handling Source: https://github.com/numediart/mbrola/blob/master/README_Makefile.md Define SIGNAL if your system supports signals and you wish to enable on-the-fly resetting of the MBROLA engine using SIG_USR1. ```makefile #define SIGNAL ``` -------------------------------- ### Visual C++ Project for DLL Compilation Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html This is a Microsoft Visual C++ 5.0 project file used to build a DLL. Ensure specific preprocessor definitions are set. ```makefile MbrolaDll.dsw ``` -------------------------------- ### Control output volume with -v parameter Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Multiplies each output sample by a specified VolumeRatio to adjust loudness. Setting the ratio too high may cause saturation. ```bash synth -v 0.7 fr1/fr1 TEST/bonjour.pho bonjour.wav ``` -------------------------------- ### Initialize Parser Input Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes a parser input, plugging a Fifo into the default parser. This is used in multi-channel mode to set up independent parsers for each channel. ```C parser1= init_ParserInput(input1,"_",120.0,";",1.0,1.0); parser2= init_ParserInput(input2,"_",120.0,";",1.0,1.0); ``` -------------------------------- ### Fifo Object Methods Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declares the standard methods for the Fifo object, including constructor (init_Fifo), destructor (close_Fifo), and utility functions (reset_Fifo, write_Fifo, readline_Fifo). ```c Fifo* init_Fifo(int size); /* * Constructor with size of the buffer */ void close_Fifo(Fifo* ff); /* * Release the memory */ void reset_Fifo(Fifo* ff); /* * Forget previously entered data in the circular buffer */ int write_Fifo(Fifo* ff, char *buffer_in); /* * Write a string of phoneme in the input buffer * Return the number of chars actually written */ int readline_Fifo(Fifo* ff, char *line, int size); /* * Read a line from the input stream in a circular buffer * Return 0 if there's nothing to read */ ``` -------------------------------- ### Initialize Input Fifo Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes an Input Fifo structure with a specified buffer size. This is used for managing phoneme input streams in multi-channel mode. ```C fifo1= init_Fifo(100); fifo2= init_Fifo(100); fifo3= init_Fifo(100); ``` -------------------------------- ### Unzip Distribution File Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to extract the MBROLA distribution files. Replace XXXX with the version number. ```bash unzip mbrXXXX.zip ``` -------------------------------- ### Set Volume Ratio Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Sets the overall volume ratio for MBROLA synthesis. ```c void DLL_EXPORT set_volume_ratio_MBR2(Mbrola* mb, float volume_ratio); ``` -------------------------------- ### Set Parser Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Replaces the current parser with a new one for MBROLA synthesis. ```c void DLL_EXPORT set_parser_MBR2(Mbrola* mb, Parser* parser); ``` -------------------------------- ### MBROLA Diphone Frame Initialization Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Initializes the real frame structure, establishing the link between logical and physical frames, used by the loadiphs function. ```c void init_real_frame(Database* dba, DiphoneSynthesis* diph); /* * Make the link between logical and physical frames -> used by loadiphs */ ``` -------------------------------- ### PhoneBuff Initialization Function Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declares the function to initialize a PhoneBuff structure, setting up default phonemes, pitch, and ratios. ```c PhoneBuff* init_PhoneBuff(Input* my_input, char* default_phon,float default_pitch, float time_ratio, float freq_ratio,char* comment, char* flush); ``` -------------------------------- ### Define Processor Architecture Source: https://github.com/numediart/mbrola/blob/master/README_Makefile.md If your system is not explicitly listed, define one of these preprocessor directives for the processor architecture. ```makefile __i386 __powerpc__ __sparc ``` -------------------------------- ### Setting voice frequency in .pho file Source: https://github.com/numediart/mbrola/blob/master/README.md Shows how to embed voice frequency settings directly within a .pho file using special escape sequences. ```text ;; F=0.8 ``` -------------------------------- ### Command File Declaration Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declares the global file pointer for the command input, which can be standard input. ```c extern FILE *command_file; /* File providing the phonetic input (can be stdin) */ ``` -------------------------------- ### Setting duration in .pho file Source: https://github.com/numediart/mbrola/blob/master/README.md Illustrates embedding duration adjustments within a .pho file using specific escape sequences. ```text ;; T=1.2 ``` -------------------------------- ### Unzip Synth Archive on PC/DOS Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Use this command to restore files on PC/DOS platforms. Ensure embedded paths in the archive are restored. ```bash "pkunzip synthXXXX.zip" ``` -------------------------------- ### MBROLA Phoneme Input with Parentheses for Pitch Targets Source: https://github.com/numediart/mbrola/blob/master/README.md An alternative .pho file format where pitch targets are enclosed in parentheses for improved readability. ```plaintext _ 51 (25,114) ``` -------------------------------- ### Enable ROM Database Storage Source: https://github.com/numediart/mbrola/blob/master/Documentation/rom_documentation.txt Compiler flag to enable saving ROM images from regular diphone databases. This symbol must be defined in the Makefile or project settings. ```makefile CFLAGS += -DROMDATABASE_STORE ``` -------------------------------- ### Write Audio File Header Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Declares a function to write the header for an audio file. It takes the file format, audio length, and sample rate as input to create a correctly formatted header. ```c void write_header(WaveType file_format, int32 audio_length, uint16 samp_rate, FILE *output_file); ``` -------------------------------- ### Rename, Clone, and Dump ROM Image Source: https://github.com/numediart/mbrola/blob/master/Documentation/rom_documentation.txt Command to perform operations like renaming and cloning on a database, then dumping the modified image to a ROM file. Note that renaming cannot be directly applied to a ROM image. ```bash mbrola -R "a b c d" -C "b i" fr1 ``` -------------------------------- ### Define Preprocessor Symbols in Makefile Source: https://github.com/numediart/mbrola/blob/master/Documentation/documentation301.html Comment or uncomment these lines in the Makefile to define preprocessor symbols based on your target architecture and desired build mode. ```makefile #CFLAGS += -DDEBUG #CFLAGS += -DDEBUG_HASH #CFLAGS += -DLITTLE_ENDIAN CFLAGS += -DBIG_ENDIAN ``` -------------------------------- ### Synthesize speech with MBROLA Source: https://github.com/numediart/mbrola/blob/master/README.md Basic command to synthesize speech for the word 'bonjour' using the FR1 database and saving the output as a WAV file. This demonstrates the core functionality of MBROLA. ```bash mbrola fr1/fr1 fr1/TEST/bonjour.pho bonjour.wav ```