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

Getting exception when creating SDL2AudioEndPoint instance when SIPSorcery package is installed. #1155

Open
hossam14102010 opened this issue Jul 31, 2024 · 1 comment

Comments

@hossam14102010
Copy link

hossam14102010 commented Jul 31, 2024

I was trying to use SIPSorceryMedia.SDL2 library in a simple console application:

using SIPSorcery.Media;
using SIPSorceryMedia.SDL2;

SDL2Helper.InitSDL();
SDL2AudioEndPoint endpoint = new("Speakers (Realtek High Definition Audio)", new AudioEncoder());

but on the fifth line I get this exception:

System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'Microsoft.Extensions.Logging.ILogger SIPSorcery.LogFactory.CreateLogger()'.
Source=SIPSorceryMedia.SDL2
StackTrace:
at SIPSorceryMedia.SDL2.SDL2AudioEndPoint..ctor(String audioOutDeviceName, IAudioEncoder audioEncoder)
at Program.Main(String[] args) in C:\Users<UserName>\source\repos\ConsoleApp4\ConsoleApp4\Program.cs:line 5

I am using .NET 8, and I tried both SDL2-2.0.20-win32-x64 (as mentioned in the README) and SDL-2.30.5-win32-x64 (lates version)
I have also tried .NET 9.0-Preview and I have tried to install Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Console and I got the same exception on the same line.

Edit:

The Exception is only thrown when SIPSorcery package is installed. when I remove it no exception is thrown.

@hossam14102010 hossam14102010 changed the title Getting exception when creating SDL2AudioEndPoint instance. Getting exception when creating SDL2AudioEndPoint instance when SIPSorcery package is installed. Jul 31, 2024
@hossam14102010
Copy link
Author

I have downloaded this repository and created a new .NET class library and added the classes under src folder into it and built DLLs when I add those DLLs to the Console app and remove the NuGet package I can use the SDL2AudioEndPoint successfully

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

1 participant