HELP SPEAK_ESPEAK                                 Aaron Sloman July 2009

Allows pop-11 to invoke the espeak (speech generator) library

speak_flite(string|word|list of words or strings)

Requires unix/linux program 'espeak' to be installed.


section;

global vars espeak_speed;

if isundef(espeak_speed) then
    120 -> espeak_speed
endif;

define speak_espeak(sentence);
    ;;; sentence should be a string or word or list of strings or words.
    if islist(sentence) then
        flatten(sentence) -> sentence;
    endif;

    ;;; get all printing dnow
    sysflush(popdevout);
    sysflush(poprawdevout);
    ;;; Make sure there is a space in the input to flite
    ;;; use slightly reduced speed, 120 not default 170
    if isinteger(espeak_speed) then
        sysobey('espeak -s 120 "'>< sentence ><'"');
    else
        sysobey('espeak -s 120 "'>< sentence ><'"');
    endif
    
enddefine;

endsection;

--- $usepop/pop/help/speak_espeak
--- Copyright University of Birmingham 2009. All rights reserved.
