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

UWP / .NETStandard compatibility #2

Open
BRB2000 opened this issue Mar 7, 2021 · 6 comments
Open

UWP / .NETStandard compatibility #2

BRB2000 opened this issue Mar 7, 2021 · 6 comments

Comments

@BRB2000
Copy link

BRB2000 commented Mar 7, 2021

Hey,

first of all, thank you so much for this awesome library!
I am trying to use SIPSorcery in an UWP project. Unfortunately, the SIPSorceryMedia.Windows package does not work on UWP (getting System.TypeLoadException: "Could not load type 'NAudio.Wave.WaveInEvent' from assembly 'NAudio, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null'.". I kinda expected this to happen. I wanted to try out the FFmpeg implementation before trying to implement my own AudioEndpoint. The SIPSorceryMedia.FFmpeg package does install on a UWP project just fine, however, the namespace is not available. I figured this has to do with it targeting .NETCore. Is it possible to make it a .NETStandard library?

Best regards
Richard

@sipsorcery
Copy link
Member

Is it possible to make it a .NETStandard library?

I don't see why not. Although there may be something in the UWP sandbox that trips up the interop with the FFMpeg native libraries.

I've gone ahead and committed a change that switches the target framework to netstandard2.1.

You can try it out locally by pulling the change and then building and referencing a custom built nuget package.

sipsorcerymedia.ffmpeg> dotnet pack src\SIPSorceryMedia.FFmpeg.csproj -p:NuspecFile=SIPSorceryMedia.FFmpeg.nuspec -c Release

If that works with your UWP app I can publish an official nuget package.

@BRB2000
Copy link
Author

BRB2000 commented Mar 7, 2021

Wow, that was very quick. I have tried to reference the package, again with no luck. I came across this article by Microsoft that UWP doesn't currently support .NETStandard2.1. I have tried to target 2.0, but that didn't work either. Could you try to add SIPSorceryMedia.FFmpeg to an UWP solution? I found it to work perfectly in .NETCore console applications though (as found in the example you provided).

@sipsorcery
Copy link
Member

Could you try to add SIPSorceryMedia.FFmpeg to an UWP solution?

UWP apps aren't something on top of my list at the moment. I don't mind making adjustments for them but I don't plan on doing any digging.

If you are building a WebRTC app, and you haven't already seen it, then maybe take a look at MixedReality-WebRTC.

@BRB2000
Copy link
Author

BRB2000 commented Mar 10, 2021

I have created an implementation of IAudioSink and IAudioSource based on the AudioGraph API for the Universal Windows Platform (see https://docs.microsoft.com/en-us/uwp/api/windows.media.audio.audiograph?view=winrt-19041). Are you generally interested to include it in the sipsorcery-org repository?

@sipsorcery
Copy link
Member

Are you generally interested to include it in the sipsorcery-org repository?

Yes definitely.

People are always asking for extra ways to interface with audio devices and the more options the better. Given it's Windows specific perhaps the SIPSorceryMedia.Windows repository would be the best spot for it.

@BRB2000
Copy link
Author

BRB2000 commented Mar 30, 2021

Just wanted to give a quick follow up on this. I'm in the process of getting my implementation ready for submitting it as a pull request, but there are some bugs in the project I am using my implementation in. I want to investigate the causes before submitting it to make sure that they are not caused by my AudioSink / Source implementation. However, I don't have much time to work on this right now, so it might take some weeks.

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