1 / 14

François Gaillard francois point gaillard à gmail point com http://fgaillard.com

Delphi Speech. Synthèse et reconnaisance de la parole avec Delphi. François Gaillard francois point gaillard à gmail point com http://fgaillard.com. Agenda Vue d’ensemble Synthese Dictee Contrôle RichEdit 4.1 Delphi Prism. Delphi Speech. Architecture. Application. Application.

hollye
Download Presentation

François Gaillard francois point gaillard à gmail point com http://fgaillard.com

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Delphi Speech Synthèse et reconnaisance de la parole avec Delphi François Gaillard francois pointgaillard à gmail pointcom http://fgaillard.com

  2. Agenda • Vue d’ensemble • Synthese • Dictee • Contrôle • RichEdit 4.1 • Delphi Prism Delphi Speech

  3. Architecture Application Application Application Speech API SAPI runtime Recognition Engines TTS Engines Delphi Speech

  4. SAPI 5.1 • Fin 2001. Inclus dans le Speech SDK v5.1. • API + Moteurs de synthèse vocale (Mike and Mary) pour Windows XP. • API + Moteur de reconnaissance v6 TRES amélioré pour Office 2003 (+ L&H Michael & Michelle) et Windows XP Tablet PC. • SAPI 5.2 • 2004. Version spéciale de l'API spécialement pour Microsoft Speech Server. • Support pour Speech Recognition Grammar Specification (SRGS) and SSML mark-up languages, fonctionnalités serveurs and performance. • Speech Server inclus la v6 du moteur de reconnaissance desktop and la v7 du moteur serveur. • SAPI 5.3 = Refonte majeure • API incluse dans Windows Vista avec de nouveaux moteurs pour la reconnaissance (Version 8) and la synthèse (Anna). • Reconnaissance vocale complètement intégrée dans l'OS • => Speech SDK et APIs inclus dans le Windows SDK général. • SAPI 5.4 • Mise a jour pour Windows 7. Un peu d’histoire (récente) Delphi Speech

  5. Synthèse • Facile, résultat rapide • Bien pour «late binding» (pas besoin de Type Library) • Seulement besoin de quelques méthodes ou propriétés • Très amélioré dans Vista (SAPI 5.3), et Win7 (SAPI 5.4) • Exemple d’application avec très peu de code • Attention au piège Vista (& Win7) • Lecture en français avec Speech Server • Application de lecture ReadAloud • Message d’erreur sonore • Lecteur • Jouer avec les paramètres et XML(SSML) Delphi Speech

  6. Flags TTS • SVSFDefault: pour utiliser les valeurs par defaut. • synthèse synchrone (outrepasser avec SVSFlagsAsync), • Sans purge des lectures en attente (outrepasser avec SVSFPurgeBeforeSpeak), • Interpréter le texte comme XML seulement si le 1er caractère est "<"   (outrepasser avecSVSFIsXML ou SVSFIsNotXML), • Changements globaux XML volatiles entre les appels (outrepasser avec SVSFPersistXML) • Caractères de ponctuation silencieux (outrepasser avec SVSFNLPSpeakPunc). • SVSFlagsAsync: Appels asynchrones. Rend la main immédiatement après la mise en file de la requête. • SVSFPurgeBeforeSpeak: Purge toutes les requêtes en attente avant cet appel. • SVSFIsFilename: Le texte passe en paramètre est un nom de fichier et non un texte à lire. C’est le fichier désigné dont le contenu est lu, pas la chaine elle-même. • SVSFIsXML: Le texte entré est interprété comme XML. • SVSFIsNotXML: Le texte entré n’est pas interprété comme XML. • SVSFPersistXML: Les changements globaux passés par XML persistent entre les appels. • SVSFNLPSpeakPunc: Les caractères de ponctuation sont prononcés ("Voilà." devient " Voilà point"). • SVSFParseSapi: Force interprétation XML comme MS SAPI. • SVSFParseSsml: Force interprétation XML comme W3C SSML. • SVSFParseAutoDetect: Auto-détection XML. Par défaut, si aucun de ces flags n’est inclus. • SVSFNLPMask: Flags utilisés par SAPI (et non pas le moteur de synthèse). • SVSFParseMask: SVSFParseSapi|SVSFParseSsml • SVSFVoiceMask: Masque SAPI 5.1 incluant tous les bits. Pour 5.3, il inclut aussi SVSFParseMask. • SVSFUnusedFlags: Masque avec tous les bits non définis mis à 1. Delphi Speech

  7. SAPI XML TTS • Balises de contrôle d‘état de la Voix • Volume: 0..100 (%) <volume level="50">Spoken at volume level fifty.</volume> <volume level="80"/>Spoken at volume level eighty from here. • Rate: -10..10 (0: débit normal, >0 plus rapide, <0 plus lent) • absspeed: fixe une valeur absolue • speed: augmente ou diminue la vitesse • Pitch: -10..10 (0: hauteur normale, >0 plus aigue, <0 plus grave) • absmiddle: • middle: • Emph: emphase pour une portion de texte <emph> boo </emph>! • Spell: force la voix a épeler les texte <spell>These words should be spelled out.</spell> Note: emph and spell ne peuvent pas etre vides (pour la suite du texte) Pour Speech Server compatibilité, voir: http://msdn.microsoft.com/en-us/library/dd450827(v=office.13).aspx Delphi Speech

  8. SAPI XML TTS • Balise d’insertion directe • Silence: insert un silence en ms <silence msec="500"/> • Bookmark: insert un marqueur dans le flux de sortie audio. Déclenche un événement dans l’application lorsque le flux l’atteint. <bookmark mark="bookmark_one"/> • Pron: insert une prononciation explicitée par des phonèmes <pron sym="h eh 1 l ow & w er 1 l d "/> <pron sym="h eh 1 l ow & w er 1 l d"> hello world </pron> Delphi Speech

  9. American English Phoneme Table SAPI XML TTS Delphi Speech

  10. Dictée • Importer la Speech Type Library (plus pratique) • Activer la reconnaissance vocale sur votre ordinateur • Et l’entrainer: Faites le tutorial! • Rapide • Amusant • Vraiment efficace • Application Dictée: • Comment remplir un Memo sans clavier en 10 lignes de code Delphi Speech

  11. Contrôle • Définir une Grammaire • Application Dictée (le retour) • Comment contrôler votre Memo en moins de 10 lignes de code Delphi Speech

  12. RichEdit 4.1http://fgaillard.com/2010/09/using-richedit-4-1-with-d2010/ • Meilleure compatibilité graphique • Capacités vocales améliorées (go to start of sentence) • unit ComCtrls; • {$define richedit41} // FG. try to load enhanced RichEdit • {$ifdef richedit41} • RichEditModuleName = 'MSFTEDIT.DLL'; • OldRichEditModuleName = 'RICHED20.DLL'; • {$else} • RichEditModuleName = 'RICHED20.DLL'; • {$endif} • {$ifdef richedit41} IsRichEdit41: Boolean; {$endif} • NewRichEditClassName = 'RICHEDIT50W'; • RichEditClassName = 'RICHEDIT20W'; • {$ifdef richedit41} • if IsRichEdit41 then • CreateSubClass(Params, NewRichEditClassName) • else • {$endif} Delphi Speech

  13. Delphi Prism • Project | add reference: System.Speech / Microsoft.Speech • Uses: System.Speech.Synthesis / Microsoft.Speech.Synthesis • Create a new SpeechSynthesizer • FVoice := new SpeechSynthesizer(); • Set properties Rate and Volume • FVoice.Volume := Integer(edtVolume.Value); • FVoice.Rate := Integer(edtRate.Value); • Speak • FVoice.SpeakAsync(richTextBox1.Text); Delphi Speech

  14. Delphi Speech Autres infos Microsoft Speech http://msdn.microsoft.com/en-us/library/ee721044.aspx Microsoft Speech API (SAPI) 5.4 http://msdn.microsoft.com/en-us/library/ee125663(v=VS.85).aspx Mon blog http://fgaillard.com/tag/speech Difference System.Speech.Recognition / Microsoft.Speech.Recognition http://social.msdn.microsoft.com/Forums/en/ucmanagedsdk/thread/39ec282d-cc51-49c7-9686-0e4d3f9b8516 François Gaillard Francois point gaillard à gmail point com http://fgaillard.com

More Related