Je suis nouveau à C# et je suis nouveau à Speech.Recognition. J'ai cherché très longtemps pour des tutoriels, mais je n'ai pas trouvé grand-chose, je ne suis même pas sûr d'avoir tout compris correctement.C# et Microsoft Speech.Recognition et Speech.Synthesis
Je téléchargé:
Je suis la programmation locale, je Windows XP, NET Framework 3.5.
Maintenant, je veux juste commencer avec quelques lignes de code simples, comme dire "bonjour monde" ou dire un ou deux mots en entrée.
J'ai essayé la suite, et bien sûr, il ne fonctionne pas:> erreur:
"The Typ- or Namespacename "SpeechSynthesizer" couldn't be found (Is a Using-Direktive or a Assemblyverweis missing?)"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Recognition;
using System.Speech.Synthesis;
namespace System.Speech.Recognition { }
namespace System.Speech.AudioFormat {}
namespace System.Speech.Recognition.SrgsGrammar{}
namespace System.Speech.Synthesis { }
namespace System.Speech.Synthesis.TtsEngine { }
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
SpeechSynthesizer foo = new SpeechSynthesizer();
foo.Speak("Test");
}
}
}
modifier:
bonjour, j'ai essayé votre code, mais en utilisant SpeechLib; n'a pu être trouvée:>
bien maintenant je l'ai écrit:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Recognition;
using System.Speech.Synthesis;
using System.SpeechLib;
namespace System.SpeechLib { }
namespace System.Speech.Recognition { }
namespace System.Speech.AudioFormat {}
namespace System.Speech.Recognition.SrgsGrammar{}
namespace System.Speech.Synthesis { }
namespace System.Speech.Synthesis.TtsEngine { }
mais je reçois une erreur:
numericUpDown1,SpVoice,SpeechVoiceSpeakFlags,textBox1 and Timeout
+1. 'Using' ne fait que créer des raccourcis vers les espaces de noms. Pour les utiliser, vous devez lier des assemblys au projet. – Mike
merci, j'ai pris system.speech et maintenant ça marche! greate - (savez-vous comment je passe à la langue allemande?) – Tyzak
Oui, trois années d'allemand au lycée aidé. Mais je ne pense pas que vous l'obtiendrez sur une machine Windows à moins que la version Windows soit allemande. Pas sûr de ce qui est nécessaire, de l'argent sans doute. Commencer une autre question à ce sujet sur superuser.com –