I am integrating a video player to an existing .NET WinForms application.
I first tried to use "Windows Media Player Control" which is included in Windows SDK,
but I could not change the playback rate.
The following is the code I wrote to change the rate.
if (axWindowsMediaPlayer1.settings.get_isAvailable("Rate"))
{
axWindowsMediaPlayer1.settings.rate = 3.0;
}
The condition in the if statement always returns "false" no matter what video file I use. Does anyone have any idea why I cannot change the rate? It really needs to be available to change the playback rate, so WMP control seems to be a bad choice if it's impossible to do so.
Or, is there any alternative solution which allows me to change the rate? Preferably a .NET based library which does not involve any unmanaged code.
Thanks!
I ended up using DirectShow.NET (http://directshownet.sourceforge.net/) which is an open-source library. It contains a lot of samples, and it has a sample with playback rate control.
IF a commercial library is an option take a look at http://www.visioforge.com/media-player-sdk-net.html
Another commercial option would be Leadtools MultIMedia SDK - see http://www.leadtools.com/sdk/multimedia.htm#+cp_playback
Is the if statement really necessary?
I could set the rate fine without it..
axWindowsMediaPlayer1.settings.rate = 3.0;
Related
I need to implement some sort of library that allows me to pick (one or multiple), edit, crop, resize, move and apply other effects on user's photos that will be sent to a server later.
I tried to write my own code to do so but it takes much more time and it's quite difficult.
Do you know some libs (open-source or not) that give me the chance to do so?
For editing I know:
Media plugin https://github.com/jamesmontemagno/MediaPlugin
UCrop: https://github.com/NAXAM/ucrop-android-binding
You can bind any library from native to xamarin
Just use SkiaSharp, its free has tons of documentation and is cross-platfrom
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
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/
I have a Creative Life CAM Optia AF webcam, the software included in the package is able to control the camera in different ways, like set autofocus to auto or manual, and a bunch of gamma and brightness settings.
I'm capturing the feed with the AForge Computer vision library, and it's working great.
But i would like to be able to set the manual focus from inside my application.
Ive been searching for a tutorial, but come up empty handed.
Can i somehow either disassemble the included software, or is there some way to fetch the traffic / instructions being sent to the device?
Thanks in advance.
If the license agreement that comes with the software allows you to disassemble it, you can do so with Reflector (assuming that it's a .NET application).
How to programatically disable the auto-focus of a webcam?
I think i found a way to do this. But i have never written any C++, that is C++ right?
Thanks :)
I am now facing one problem which to get the live image from Camera (eg. Sony, Canon) into winform and also control the camera capture button from a button in the form.
have Anyone build something like this, or are there any similar project like this which is done in C#?
This hardly depends on the capabilities of the camera and its driver. Your biggest chance might be the Windows Image Acquisition (WIA) framework.
Take a look at this article or the MSDN reference.
Emgu cv is a project that provides all the bindings for OpenCV. I've used it on both Windows and Linux platforms (Mono) with great success.
http://emgu.com/
http://emgu.com/wiki/index.php/Camera_Capture_in_7_lines_of_code
You can also take a look on Intel OpenCV.
It's C++, but you can use use PInvoke to use it from c#
This project supports even high-end PTZ camera. Code Project - Versatile WebCam C# library.
It uses Touchless.Vision and WebCamLib