Re: Text to File programme

Richard Russell
 

On Wed, Apr 5, 2017 at 09:05 am, CHABI Salomon wrote:
My computer is configured in french.
But the programme reads the numbers for instance in english.

Interesting that the text-to-speech defaults to English, I wouldn't have expected that.  But, yes, you can try adding an explicit selection of French as the language to use:

      INSTALL @lib$+"COMLIBA"

      ON ERROR PROC_comexit : PRINT 'REPORT$ : END
      ON CLOSE PROC_comexit : QUIT

      PROC_cominit

      Pitch% = 0
      Speed% = 0
      Voice$ = ""
      Lang$ = "40C"

      REPEAT
        READ phrase$
        PRINT phrase$
        PROCspeak(phrase$,Pitch%,Speed%,Voice$,Lang$)
      UNTIL phrase$ = ""
      PROC_comexit
      END

      DATA "Parlez vous Français?"
      DATA

      DEF PROCspeak(phrase$,pitch%,speed%,voice$,lang$)
      tts% = FN_createobject("Sapi.SpVoice")
      IF tts% THEN
        LOCAL qual$
        qual$ = "<PITCH ABSMIDDLE="""""+STR$pitch%+"""""/><RATE ABSSPEED="""""+STR$speed%+"""""/>"
        IF voice$<>"" qual$ += "<VOICE REQUIRED=""""NAME="+voice$+"""""/>"
        IF lang$<>"" qual$ += "<VOICE REQUIRED=""""LANGUAGE="+lang$+"""""/>"
        PROC_callmethod(tts%, "Speak("""+qual$+phrase$+""")")
        PROC_releaseobject(tts%)
      ENDIF
      ENDPROC

Richard.

Join bb4w@groups.io to automatically receive all group messages.