Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Refrence Exception in Encoding Thread #68

Open
Platratio34 opened this issue Jan 10, 2023 · 3 comments
Open

Null Refrence Exception in Encoding Thread #68

Platratio34 opened this issue Jan 10, 2023 · 3 comments

Comments

@Platratio34
Copy link

Platratio34 commented Jan 10, 2023

Overview

I basically copied the code from the GUI example (witch was working with the same versions of everything), and when I run it I get a null reference exception when I try to connect to a mumble server. It is connecting to the mumble server, witch is the uMurmur server integrated in CitizenFX Framework (FiveM/RedM), and I have confirmed that it did actuality join with a standard client also in the server. There is also about a 5 second delay from when I run the connect function, and when I get the error, and it receives 7 messages during that time.

Stack Trace

Unhandled exception. System.Exception: BasicMumbleProtocol's _encodingThread was terminated unexpectedly because of a System.NullReferenceException
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MumbleSharp.Audio.Codecs.Opus.OpusDecoder..ctor(Int32 outputSampleRate, Int32 outputChannelCount)
   at MumbleSharp.Audio.Codecs.Opus.OpusCodec..ctor(Int32 sampleRate, Byte sampleBits, Byte channels, UInt16 frameSize)
   at MumbleSharp.Audio.CodecSet.<>c__DisplayClass4_0.<.ctor>b__0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at MumbleSharp.Audio.CodecSet.GetCodec(SpeechCodecs codec)
   at MumbleSharp.Audio.AudioEncodingBuffer.Encode(SpeechCodecs codec)
   at MumbleSharp.BasicMumbleProtocol.EncodingThreadEntry(Exception& exception)
   --- End of inner exception stack trace ---
   at MumbleSharp.BasicMumbleProtocol.<Initialise>b__40_1()
   at System.Threading.Thread.StartCallback()

Versions

  • net6.0-windows
  • MumbelSharp 2.0.0
  • NAudio 2.1.0
  • protobuf-net 3.1.26
@Meetsch
Copy link
Collaborator

Meetsch commented Apr 26, 2023

Can you please check that opus.dll is copied over in the output Subfolder "\Audio\Codecs\Opus\Libs\32bit"

@Platratio34
Copy link
Author

There is an opus.dll at bin\Debug\net6.0-windows\Audio\Codecs\Opus\Libs\32bit\ as well as one in the 64bit folder. I am running it in VS Code.

@Meetsch
Copy link
Collaborator

Meetsch commented May 10, 2023

The Nuget package has been updated to v2.0.1 so that the needed codecs files opus.dll are automatically copied to the output folder of projects referencing the nuget package, this should solve your issue. Please report if it did solve your issue or not, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants