Universal Windows Platform (UWP) write image to disk sectors - c#

There are alot of examples of writing files to disk using UWP apis but is it possible to write an image file (.img) to disk using UWP apis + c# much in the same way win32DiskImager does?

There is no UWP API can operate .img file. For C#, you can try with
.NET DiscUtils. DiscUtils is a .NET library to read and write ISO files. However this library still can't be used in UWP apps.
So I'm afraid it's impossible to write an image file (.img) to disk using UWP APIs + C#.

Related

How to decompress MP3 to WAV in Windows Store app?

I want to find pitches in raw of wav file using FFT and etc. but before I should to decompress MP3 file.
I am using C# with WinRT, and I'm very limited for third-party libraries which often cause exceptions.
You might try NLayer. It's purely managed code (with no P/Invoke), so it should run just fine in a WinRT app.
Disclaimer: I am a major contributor to NLayer.

WinRt C# Audio Library

I am looking to develop an app in C# WinRt, but was wondering what libraries are available for playback and for complicated manipulation. I am looking for a free library that allows for an extensive list of audio formats to be played (for example mp3, wma, wav, ogg, etc.) and also to be analyzed. Thats pretty much the basic functionality I would need. But if I could get picky, a library that can convert audio files between the formats would be handy. Doing a google search I came across the Naudio library, but it was not so greatly compatible with WinRt.Thanks for any tips or advice on this.
The current alpha build of NAudio 1.7 (available via NuGet) does contain a Windows RT assembly and the source code includes a simple demo of playback and recording as a Windows Store app. Since it uses Media Foundation, you'll be able to play most of the file types you suggested (although ogg won't be supported out of the box), and you can construct your audio pipeline to access the audio as floating point samples for analysis.
Things that aren't currently supported are using the Media Foundation encoders to encode, and the various reader/writer classes need to be re-written to use the WinRT asynchronous streams and File I/O APIs instead of the regular .NET ones. Hopefully these features will be added to the library soon.

How to change the resolution of a WMV file in C#

I have a C# application and I would like to be able to read in a WMV file and then write out a WMV file with reduced resolution/quality.
Are there any built-in libraries for C# that can do this? Do I need the Windows Media Format SDK?
Does anyone have experience with this?
Can I use something like FFmpeg for this?
You will have to decode and re-encode ( = transcode) the file to do this. By doing so you will inherently reduce quality since you are working off an already compressed base.
One way to do it if you need a high degree of control is is with a DirectShow wrapper for C#, i.e. DirectShow.NET. then you just need to define a simple transcoding graph.
Actually the simplest way to do this is with Expression Encoder (the successor to Windows Media Encoder) which has a simple managed API and should do the job with much less effort than integrating DirectShow.
There's a summary article here. A simple transcoding job looks like this (sample from article, only presets changed):
MediaItem src = new MediaItem
(#"C:\WMdownloads\AdrenalineRush.wmv");
Job job = new Job();
job.MediaItems.Add(src);
job.ApplyPreset(Presets.VC1WindowsMobile);
job.OutputDirectory = #"C:\EncodedFiles";
job.Encode();
I don't think there are any classes in the .Net Framework which deal with transcoding WMV files.
But you can install the Windows Media 9 Encoder SDK and create appropriate objects in C# to do the conversion. See CodeProject.com - Convert MP3, MPEG, AVI to Windows Media Formats for a starting point. Even though that link starts with non-WMV files, the Windows Media Encoder doesn't restrict the input file format (at least when I've used the VBScript encoding batch file).
N.B If you use the WM9Encoder on Vista or Win7, you may need the hotfix - see TechNet - issues in using Windows Media Encoder 9 Series on Windows 7

.Net sdk for video editing like Windows Movie Marker

i am currently working on .net application which contains one audio & video file.
audio file is split as in to small section as per database entries. then we have to merge this files on video file at specific positions.we what something like windows movie maker
it will be nice if someone suggest some .net based sdk for this.
You can use ffmpeg for this purpose. But you will need a .net wrapper to make it usable in C#.
You can use ffmpeg-sharp or SolidFFMpeg. its a a wrapper library over the FFmpeg multimedia suite that provides easy to use wrappers for use in C#.
Datastead Software's TVideoGrabber Video SDK has this feature.
"join several video clips and/or audio clips into a single one, in full or by specifying respective start times and end times"
http://www.datastead.com/products/tvideograbber/features.html
The engine behind Windows Movie Maker is DirectShow Editing Services. You can use it via DirectShow.NET.

Record and save audio in c# .net web application

Is there anyway that I can record sound from a microphone using c# .net
What is the best option if i have to save the audio online in terms of the file occupying storage space.
Any particular format that the file should be saved in for optimum output.
I think you have to use either a small flash application or a silverlight application to do the actual recording. Then you upload the file to your application using a web service or similar.
And mp3 is sort of a standard file format for sound on the web. So I'd go with that.
Have a look at these projects:
http://www.codeproject.com/KB/winsdk/SoundRecord.aspx
http://www.codeproject.com/Articles/67568/Creating-a-Sound-Recorder-in-C-and-Csharp.aspx
http://www.codeproject.com/KB/audio-video/cswavrec.aspx
What is the best option if i have to save the audio online in terms of the file occupying storage space.
May be real media (.rm).
Any particular format that the file should be saved in for optimum output.
Not sure but I think that depends on
your player.
You might also be interested in ffmpeg for converting the media and its c# wrapper library.

Categories

Resources