NAudio on Silverlight - c#

Is it possible to use the NAudio on a silverlight application?
I just can't add the dll to my project... I'd like to build a little audio mixer.
I already searched on google but i can't find a way to do that...
someone has some hints for it???

NAudio uses tons of interop into Win32 functions that would be completely impossible to run in Silverlight.
UPDATE:
If you are looking for an MP3 player for Silverlight you may check out the Silverlight Audio Player.

Related

How to make the headphones hear the microphone in C# (not streaming)

Windows Sound mixer/settings can set the microphone to play over the speakers. I'm looking for a way to do that through C#. I'm assuming there is a DLL reference or .NET call that might be able to.
Everything I've been finding invariably goes back to streaming, which I don't want to do. Unless that's whats actually happening under the hood when changing the audio settings in windows.
If it helps, I'm using C# 3.5 (Unity App) and running on Windows 10 latest.
Thanks!
You can do this with Core Audio APIs link
For implementation you can refer
https://blog.sverrirs.com/2016/02/windows-coreaudio-api-in-c.html

Play sound with reverb effect with NAudio library?

I am using in my C# winForms application great audio library - NAudio. I am playing sounds by the use of WAVE cache and PlayEngine and i have a question:
Is it possible (and if YES: how?) to play sound with reverb effect with NAudio?
NAudio does not include a reverb effect. It does provide access to the raw audio samples, so you can implement your own effect algorithms. Another option might be to see if there is a Reverb MFT installed and pass the audio through (in the same way that the NAudio MFResampler works).
So the short answer is, unfortunately it's not easy to do.

c# mixing two audio files in windows phone 8.1 silverlight project

My goal is to mix 2 audio files that is one voice and one background music. For mixing I am using NAudio.
The problem is I am getting following exception while reading mp3 file using NAudio's Mp3FileReader.
DllImport cannot be used on user-defined methods
I am using NAudio in Windows Phone 8.1 Silverlight app project. I am not sure if NAudio is useable on WP Silverlight app if its useable then please help by providing a code example or suggest any other library or custom implementation to mix 2 audio files.
No, I'm afraid NAudio is not usable on Silverlight, as it makes lots of calls into Windows APIs which you can't do in Silverlight. You can take a look at the NAudio NLayer project which offers fully managed MP3 decoding. You could use that in conjunction with some of the more generic helper classes in NAudio like the MixingSampleProvider to perform the mixing you require. Of course the next issue would be what you want to do with that mixed audio. Silverlight does have a way of streaming user generated audio using the MediaElement but NAudio does not provide support for this directly.
[DllImport] requires a substantial chunk of code in the CLR, nothing very subtle about the pinvoke marshaller. That's a problem on a phone, it runs a special version of the CLR named .NETCore. Probably better known today as the codebase that spun-off the CoreCLR open source project. Keeping it small required unsubtle choices, pinvoke fell on the floor.
So no, you'll have no use at all for NAudio. You'll have to dip into the built-in support for audio. The relevant oversight MSDN page is this one. This blog post is relevant.
As you can tell, XAudio2 is your ticket with direct support for mixing. There is a learning curve of course, the language is probably the first obstacle given the question tags. Get started with this sample to get the basics.
Maybe you should consider taking the step to upgrade from WP8.1 Silverlight (WPS) project to WP8.1 (WinRT) one so that you have better access to audio APIs...
...or directly to a UWP/Win10 app (if you don't plan to release immediately to phones). If you choose that path, you could try maybe a free preview tool that converts WPS to UWP, just released from Microsoft and Mobilize.NET - https://blogs.windows.com/buildingapps/2015/09/17/initial-preview-of-silverlight-bridge-to-uwp/

Windows Multimedia API winmm.dll library too slow

i am using Windows Multimedia API winmm.dll library to play MP3 files and when i load a song it takes kins of 3-5 seconds to open and start the song . I wish to make a music app and that requires fast loading. Any ideas how i can improve the code ?
Here is the code i've used : http://www.geekpedia.com/code111_Play-MP3-Files-Using-Csharp.html
Regards,
Alexandru Badescu
I am not an audio/video expert but from my experience it's very limited in managed code. You either have to get into the win32 API or go the DirectX route. DirectSound cannot play mp3 files natively. You will need to use DirectX if you don't like the win32 PInvokes response times.
You will need the DirectX SDK and then import the audio video playback namespace.
Imports Microsoft.DirectX.AudioVideoPlayback
You can then use the directx objects to play an mp3 file.
Have you looked at this?
http://www.robburke.net/mle/mp3sharp/
He claims to have a sample, using DirectSound where he plays the MP3.

Playing video (OGG Theora) in a C# WinForms application?

I'm looking for a GPL-compatible solution for playing a video file in a Windows Forms control, specifically with the OGG Theora codec?
I was looking into using the VLC player library. A Google search found this library on CodeProject, but it was apparently deleted.
Is there a mirror or a similar library available?
Check out MOGRE (such cute names), you could also build the source and do the interop by hand, but the wrapper is probably better.
have you seen vlcdotnet ?

Categories

Resources