0

我正在尝试使用语音识别制作一个 Xamarin.Forms 项目。对于 Android 来说,做起来很简单,但我对 iOS 很感兴趣。

我发现并阅读了关于 Open Ears 的信息。

当尝试使用它时,我发现了一些问题:首先我尝试使用这个 git:https ://github.com/oganix/MonoTouch-OpenEars 但 monotouch 对 Xamarin.iOS 无效:

https://www.dropbox.com/s/41rc7iyskbwby9n/error_phoenix.png?dl=0

接下来,我发现了这个问题Xamarin OpenEars Native Binding Not working on Device but works on Simulator

阅读后,我尝试制作一个绑定项目,现在我在使用 Sharpie 自动生成 Open Ears API 时遇到了这个问题:

/Users/cristian.fernandez/Workspace/Speech-iOS/OpenEarsDistribution/Framework/OpenEars.framework/Versions/A/Headers/acmod.h:50:10: fatal error: 'sphinxbase/cmd_ln.h' file not found
#include <sphinxbase/cmd_ln.h>
         ^

Binding...
System.ArgumentNullException: Value cannot be null.
Parameter name: annotation
   at ICSharpCode.NRefactory.AbstractAnnotatable.AddAnnotation (System.Object annotation) in <filename unknown>:line 0
   at ICSharpCode.NRefactory.CSharp.AstNode.AddAnnotation (System.Object annotation) in <filename unknown>:line 0
   at Sharpie.Bind.Massagers.AnonymousStructMassager.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) in <filename unknown>:line 0
   at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (IAstVisitor visitor) in <filename unknown>:line 0
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) in <filename unknown>:line 0
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) in <filename unknown>:line 0
   at Sharpie.Bind.Massagers.AnonymousStructMassager.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) in <filename unknown>:line 0
   at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (IAstVisitor visitor) in <filename unknown>:line 0
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitChildren (ICSharpCode.NRefactory.CSharp.AstNode node) in <filename unknown>:line 0
   at ICSharpCode.NRefactory.CSharp.DepthFirstAstVisitor.VisitSyntaxTree (ICSharpCode.NRefactory.CSharp.SyntaxTree syntaxTree) in <filename unknown>:line 0
   at Sharpie.Bind.DocumentSyntaxTree.AcceptVisitor (IAstVisitor visitor) in <filename unknown>:line 0
   at Sharpie.Bind.BindingMassager.Massage (ICSharpCode.NRefactory.CSharp.AstNode astNode, BindingTarget bindingTarget) in <filename unknown>:line 0
   at Sharpie.Bind.BindingFrontend.Bind (Clang.Ast.Decl decl) in <filename unknown>:line 0
   at Sharpie.BindTool.HandleTranslationUnit (Clang.Ast.TranslationUnitDecl decl) in <filename unknown>:line 0
   at Clang.Driver.HandleTranslationUnit (Clang.Ast.TranslationUnitDecl translationUnit) in <filename unknown>:line 0
   at Clang.Driver.HandleTranslationUnit (IntPtr translationUnit) in <filename unknown>:line 0
   at (wrapper managed-to-native) Clang.Driver:RunInternal (Clang.Driver,string[],string,Clang.Frontend.DiagnosticConsumer)
   at Clang.Driver.Run (System.String[] inputFiles, System.String[] clangArgs, Clang.Frontend.DiagnosticConsumer diagnosticConsumer) in <filename unknown>:line 0
   at Sharpie.ParseTool.Run () in <filename unknown>:line 0
   at Sharpie.BindTool.CoreRun () in <filename unknown>:line 0
   at Sharpie.BindTool.Run () in <filename unknown>:line 0

我用它来启动Sharpie:

sharpie bind --output=libOpenEars --namespace=libOpenEars --sdk=iphoneos9.2 /Users/cristian.fernandez/Workspace/Speech-iOS/OpenEarsDistribution/Framework/OpenEars.framework/Versions/A/Headers/*.h

我现在除了哭还能做什么?

谢谢大家,对不起我的英语。

4

0 回答 0