2011-11-23 27 views
2

我正在使用.NET語音識別器,我試圖製作一個鬧鐘。.NET中的語音識別器datetime

所以,我需要的是語音識別明白日期,以及我做它的方式也加入到了語法一個小時的一切更多鈔票值這樣的日子:

private SemanticResultKey GetClockValues() 
    { 
     DateTime start = new DateTime(1, 1, 1, 0, 0, 0); 

     DateTime end = start.AddDays(1); 

     Choices choices = new Choices(); 

     while (start < end) 
     { 
      choices.Add(start.ToShortTimeString()); 

      start = start.AddMinutes(1); 
     } 

     return new SemanticResultKey("value", choices); 
    } 

是否有更好的方法?但願如此!

非常感謝!

+0

看到這個http://blog.vascooliveira.com/speech-recognition-and-synthesis-with-net-3-0/ - 部分合成。 SpeakAsync(「It's」+ DateTime.Now.Hour +「小時,和」+ DateTime.Now.Minute +「分鐘。」); –

回答