UniMRCP Documentation

repository·master·Indexed 19 days ago

https://github.com/unispeech/unimrcp

An open source implementation of the Media Resource Control Protocol (MRCP), compliant with MRCPv1 (RFC4463) and MRCPv2 (RFC6787) specifications. The project includes the unimrcpserver, unimrcpclient, and asrclient tools for speech synthesis, recognition, and recording tasks, as well as the UniMRCP Client (UMC) for executing XML-defined scenarios.

Tokens
2.9K
Snippets
10
Records
16
Agent score
66%

What's inside UniMRCP

  1. Understand UMC scenario classes and XML structure

    master

    Scenarios are defined in XML using the <umcscenario> tag. Each scenario must specify a name (used for execution) and a class (which determines the behavior/type of the scenario).

    Supported classes include:

    • Synthesizer: For text-to-speech tasks.
    • Recognizer: For speech recognition tasks.
    • Recorder: For recording audio.
    • Verifier: For verification tasks.
    • DtmfRecognizer: For DTMF (dual-tone multi-frequency) recognition.
    • Params: For parameter-related tasks.
    <umcscenario name="synth" class="Synthesizer">
    <umcscenario name="recog" class="Recognizer">
    <umcscenario name="rec" class="Recorder">
    <umcscenario name="verify" class="Verifier">
    <umcscenario name="dtmf" class="DtmfRecognizer">
    <umcscenario name="params" class="Params">
  2. Access UniMRCP documentation and design concepts

    master

    UniMRCP provides two types of documentation for developers:

    1. API Reference: Doxygen-generated documentation is located in the docs/dox directory.
    2. Design Concepts: UML-based design documentation (HTML pages generated by Enterprise Architect) is located in the docs/ea directory.
  3. Run UniMRCP demo applications

    master

    The unimrcpclient provides a way to test specific UniMRCP capabilities through its interactive command line. After starting the client, use the run command followed by the application type and an optional profile name.

    Supported Application Names:

    • synth: Speech Synthesis
    • recog: Speech Recognition
    • bypass: Bypass mode
    • discover: Resource discovery

    Usage Pattern: run <app_name> <profile_name>

    Note: If profile_name is omitted, it defaults to uni2.

    # Run recognition with the 'uni1' profile
    >run recog uni1
  4. Run UMC scenarios from the UniMRCP Client console

    master

    The UniMRCP Client (UMC) sample application loads scenario files from the conf/umc-scenarios/ directory. To execute a specific scenario, use the run command followed by the unique name attribute assigned to that scenario in its XML definition. Note that while multiple scenarios can share the same class, they must have unique name values to be selectable.

    > run synth
    > run recog
  5. Use the ASR client interactive command line

    master

    Once the asrclient is running, it enters an interactive mode where you can issue commands via a prompt (>).

    Available Interactive Commands:

    • run <grammar_uri_list> <audio_input_file> [profile_name | -] [params_file | -] [set | -] [get | -]
      • grammar_uri_list: A local file name, a comma-separated list of URIs (including http://, https://, or builtin:), or weighted grammars.
      • audio_input_file: Name of the audio file (PCM or WAV with RIFF headers).
      • profile_name: The client profile (e.g., uni2, uni1). Use - to skip.
      • params_file: Path to a file containing MRCP headers (e.g., N-Best-List-Length: 3). Use - to skip.
      • set: If present, sends the params_file as headers in the MRCP SET-PARAMS method. Otherwise, parameters are sent in the RECOGNIZE method.
      • get: If present, sends MRCP GET-PARAMS methods before and after recognition.

    Example Commands:

    run grammar.xml one-8kHz.pcm uni2 params_default.txt set get
    run grammar.xml one.wav
    run builtin:grammar/boolean yes.wav
    run http://example.com/grammars/grammar.grxml one.wav uni2
    • loglevel <level>: Set the log level (0-7).
    • exit or quit: Exit the application.
    >
    run grammar.xml one-8kHz.pcm uni2 params_default.txt set get
  6. Run the ASR client application

    master

    The asrclient is a command-line tool used to run demo ASR (Automatic Speech Recognition) sessions. You can launch the application with various configuration options for the project root directory, logging priority, and logging output mode.

    Command Syntax:

    asrclient [options]

    Options:

    • -r, --root-dir <path>: Set the project root directory path.
    • -l, --log-prio <priority>: Set the log priority (0-emergency through 7-debug).
    • -o, --log-output <mode>: Set the log output mode:
      • 0: none
      • 1: console only
      • 2: file only
      • 3: both
    • -h, --help: Show the help message.
    asrclient -r /path/to/root -l 7 -o 1
  7. Configure unimrcpclient logging

    master

    Logging for the unimrcpclient can be configured via command-line arguments at startup or via interactive commands during a session.

    Startup Configuration

    Use the following flags to set logging behavior immediately:

    • -l [priority]: Sets the log priority (0-7).
    • -o [mode]: Sets the log output mode:
      • 0: none
      • 1: console only
      • 2: file only
      • 3: both

    Interactive Configuration

    While the client is running, use the loglevel command:

    >loglevel 5
    unimrcpclient -l 7 -o 1
  8. Use uni_daemon_run to run the server as a daemon

    master

    The uni_daemon_run function is used to start the UniMRCP server in daemon mode. This is typically called by the main entry point when the -d (Linux) or -w (without command-line) flags are provided.

    Signature: apt_bool_t uni_daemon_run(apt_dir_layout_t *dir_layout, apt_bool_t detach, apr_pool_t *pool);

  9. Use uni_cmdline_run to run the server in foreground with command-line

    master

    The uni_cmdline_run function starts the UniMRCP server in the foreground, allowing for interactive command-line usage. This is the default mode when no daemon or service flags are specified.

    Signature: apt_bool_t uni_cmdline_run(apt_dir_layout_t *dir_layout, apr_pool_t *pool);