How to extract audio features using Accord.net C# - c#

i want to extract features of input audio files in C#. (frequencies , length , etc)
for this task i was trying to use Accord.audio nuget library. But I've failed to find a how to guide or working example that suits my need.
Can you please show me how to extract audio features of a file using accord.audio nuget library.
For an example, when i input "song.mp3" file, i want a requency array , decibal array , length etc feature of "song.mp3"

If you are looking for some tutorials on how to do stuff with Acoord.net, I think this is all you need.
and I don't think that C# is the best choice when it comes for Sound preprocessing related stuff. If you are willing to use Python, You can make use of Librosa for all your Sound Preprocessing and feature Extraction things, Dump the datasets into json file or whatever and Use it from C#.

Related

DirectShow .Net camera capture encode output?

recently i have started workin on project of my own which is capturing a camera output using DirectShow .Net. There are few problems that i don't know how ot solve
1) How can i encode the captured stream into H.264 format.I understand i should some how add filter in the filter graph. But i wasn't able to find where and how . Also i was not able to find if there is standart H.264 filter or should i download it form some where? If i need to download it can it just be a dll to wich i add reference or should it be installer?
2) Is there a way to save the captured output into a memory object, some kind of stream or it can only be written to file?
Best Regards,
Iordan
You're can use commercial software from VisioForge or Viscomsoft.
AForge potencial problem - no audio during capture, only video. Also output formats is a very limited. But - it's free and open source, if you're have any DirectShow experiense you can add audio support.
You will need to use something like FFMpeg or Handbrake. Check out http://vidcoder.codeplex.com/.
AForge also has some video editing abilities and you can also pass filters to it. There are also several FFMpeg C# wrappers you could use such as https://github.com/crazyender/FFMPEG.net
You should use AForge.net. All of the hard work is done for you already. Use VideoFileWriter http://www.aforgenet.com/framework/docs/html/4ee1742c-44d3-b250-d6aa-90cd2d606611.htm. I appears that the AForge framework uses FFMpeg under the hood as well (See AForge.Video.FFMPEG namespace). You just create a writer and pass it the bitmap/frame writer.WriteVideoFrame(bitmap);
You should fully investigate the video abstractions in AForge. You could save yourself considerable amounts of time.
Example: http://www.aforgenet.com/framework/samples/video.html
1) Yes, You should download encoder filter library. Most of decoders are supplied with free. But encoder is not. If you don't want to pay, you have to find open source Encoder.
And To use at the graphedit program, you should do dll register with that dll file. Or the installer program do this instead. And you also need to check container type like mp4, mkv... In other words you need mux filter to save that in a file. I think someone will link available urls. Sorry I don't have urls now.
2)What is that the means of capture? Is that Movie? or Image?
In case of Image, There are many sample projects and SampleGrabbers. You can save it to both of a file and memory.
In case of Movie, I'm sure your pc memory is not enougth to them with out encoding. Make memory stream and pass it to capture manager.
You can also make a filter in order to customize filter to your needs. All of information are included in Windows SDK samples.

Extracting and splitting a MP3 audio stream from an AVI file

I want to develop a desktop application by programming in C# and using the .Net framework 4.
The goal of my application is to extract a MP3 audio stream from a supplied AVI file.
I have learned from the Internet that an AVI file is a container and it might contain different audio streams.
If the supplied AVI file contains one MP3 audio stream at least then I want to extract it and split it.
I want to split the MP3 audio stream into MP3 audio parts identified with a start time and an end time.
I have looked on the Internet for any .Net library I could use but without success.
Does someone know what documented .Net library would be useful ?
Maybe you can try this:
Simple C# Wrapper for the AviFile Library
It is targeted at AVI video but there might be some clues as how to use the same methods to extract the audio only.
Either use it as-is or use the example to incorporate what you need into your own code.
Since tools for this task already exist, I see no point in creating another one unless you're curious about how to do this yourself and learn something new.
If so, using a ready-made library would defeat the entire idea of learning something which is why I strongly recommend you try implementing the splitter yourself.
You can find descriptions of the AVI file format online, that should get you started.

How to implement video and audio merger program?

I want to make a program which takes video and audio and merges them. Video type or audio type is not important for me. How can I make this? Does any library exist for this? I know there are many programs about this topic but I want to learn how to implement such a program.
The technical term for what you are trying to do is 'multiplexing', and commonly referred to as 'muxing'.
FFmpeg is a multiplatform command line tool that does this, and arguable the industry standard. Many projects wrap FFmpeg into libraries and GUIs.
FFmpeg is also open source, so you can download the code and see how they have done it. That siad, it is very big and complex.
If you are interested in the actual mechanics of muxing separate audio and video files together into a destination file, then you will need to learn much about container formats and Codecs.
Look at some sort of FFMPEG wrapper in C#.
An easy way to multiplex audio and video on linux is to use gstreamer. Here's a A/V pipeline that you can create using gst-launch on a shell prompt.
filesrc location=file1.vid ! queue ! mux. filesrc location=file2.aud ! queue ! mux. avimux name=mux ! filesink location=output.avi
Replace file1.vid with the name of your encoded video file and file2.aud with the name of your encoded audio file. output.avi is the container file that you need.

How can I create an H.264 encoded movie from a set of images in c#?

I have been doing a lot of searching today for C# libraries which will allow me to create H.264 encoded video files. Does anyone know if any such libraries or 3rd party components exist?
Use ffmpeg. I suggest to run a ffmpeg process directly, like in this sample: http://jasonjano.wordpress.com/2010/02/09/a-simple-c-wrapper-for-ffmpeg/
While the sample doesn't deal with the operation you need, I suggest to adapt it to your needs.
ffmpeg-sharp is probably a good starting point.

Video Conversion to WMV

A project I am currently working on at work requires the ability to convert videos from other formats to the WMV format. We need to be able to convert virtually any video format that is commonly used to a WMV format. I am looking for a solution allot like On2's flix engine converts other video types to .flv videos. I am aware of the encoder that windows offers, but it has a very limited list of video types that it can convert from. Please let me know if you have any suggestions or opinions, or recommendation of software I can use to do this. I need to be able to do the conversions in batch and I need to be able to do them programmatically with C#.
Have you had a look at ffmpeg?
It seems to be at the core of many open source video conversion utilities, so I imagine you could use it in the scenario you describe.
SUPER, the name is really covering the load!
Well, first you have to be able to decode the file format. You need to set this up with directshow, which is very hard to work with. You can take a look at the mediaportal project for a directshow file player written in C#. Instead of using the video renderer at the end of the directshow graph, you would reencode the video and audio and mux them into a .wmv file. This is a very involved project to get right. You essentially have to mimic a player's ability to play any format and handle failure.
I've been very satisfied using Quick Media Converter.

Categories

Resources