amirzaidi / SlimMirai

A voice recognition Discord bot powered by Discord.NET and SAPI
13 stars 5 forks source link

System.FormatException: 'one-of' must contain at least one 'item' element. #2

Open BoKnowsCoding opened 6 years ago

BoKnowsCoding commented 6 years ago

The bot boots up for me after compiling, and I make sure it has the necessary dlls and ffmpeg in the working directory, but I'm getting a System.FormatException every time the bot picks up anything on the mic.

[6/18/2018 8:06:36 PM, 10] System.FormatException: 'one-of' must contain at least one 'item' element.
   at Microsoft.Speech.Internal.SrgsParser.XmlParser.ThrowSrgsException(SRID id, Object[] args)
   at Microsoft.Speech.Internal.SrgsCompiler.OneOf.Microsoft.Speech.Internal.SrgsParser.IElement.PostParse(IElement parentElement)
   at Microsoft.Speech.Internal.GrammarBuilding.BuilderElements.CreateChildrenElements(IElementFactory elementFactory, IItem parent, IRule rule, IdentifierCollection ruleIds)
   at Microsoft.Speech.Internal.GrammarBuilding.OneOfElement.CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
   at Microsoft.Speech.Internal.GrammarBuilding.BuilderElements.CreateChildrenElements(IElementFactory elementFactory, IItem parent, IRule rule, IdentifierCollection ruleIds)
   at Microsoft.Speech.Internal.GrammarBuilding.OneOfElement.CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
   at Microsoft.Speech.Recognition.GrammarBuilder.InternalGrammarBuilder.CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
   at Microsoft.Speech.Recognition.GrammarBuilder.CreateGrammar(IElementFactory elementFactory)
   at Microsoft.Speech.Recognition.GrammarBuilder.Compile(Stream stream)
   at Microsoft.Speech.Recognition.MemoryGrammarContent..ctor(GrammarBuilder builder)
   at Microsoft.Speech.Recognition.Grammar.InitFromGrammarBuilder(GrammarBuilder builder)
   at Mirai.Audio.SpeechEngine.<Prepare>d__11.MoveNext() in C:\Users\bogar\Documents\GitHub\SlimMirai\Mirai\Audio\SpeechEngine.cs:line 64
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Mirai.Audio.Speech.<ProcessVoiceAsync>d__2.MoveNext() in C:\Users\bogar\Documents\GitHub\SlimMirai\Mirai\Audio\Speech.cs:line 62
amirzaidi commented 6 years ago

Is it possible that you don't have any music in your music library on your PC?

BoKnowsCoding commented 6 years ago

Yeah that was the issue, but one more thing, do you know what's wrong with YoutubeExplode here?

[6/20/2018 5:00:04 PM, 19] YoutubeExplode.Exceptions.VideoNotAvailableException: Video [sFg2rYQj1SE] is not available and cannot be processed.
Error code: 2
Error reason: Invalid parameters.
   at YoutubeExplode.YoutubeClient.<GetVideoAsync>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Search.SongRequest.<StreamUrl>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Mirai.Audio.Streamer.<StreamAsync>d__15.MoveNext() in C:\Users\bogar\Documents\GitHub\SlimMirai\Mirai\Audio\Streamer.cs:line 129
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Mirai.Audio.Streamer.<Start>d__12.MoveNext() in C:\Users\bogar\Documents\GitHub\SlimMirai\Mirai\Audio\Streamer.cs:line 54
amirzaidi commented 6 years ago

Try updating the dependency, youtube is making a lot of changes