Not yet, but I have a piece of code that retrieves the StreamInfo, so I think rather in Out (I checked also in my own library)
But I must get to that level of code (Run) to check.
Not yet, but I have a piece of code that retrieves the StreamInfo, so I think rather in Out (I checked also in my own library)
But I must get to that level of code (Run) to check.
// HRG(pTransform->GetOutputStreamInfo(0, &StreamInfo)); pTransform.GetInputStreamInfo(0,out StreamInfo);// if (cbOutBytes < StreamInfo.cbSize) {// cbOutBytes = StreamInfo.cbSize;// }if (cbOutBytes < StreamInfo.cbSize) { cbOutBytes = StreamInfo.cbSize; }
I watched a doc http://msdn.microsoft.com/en-us/library/windows/desktop/ms693880 (v = VS.85). aspx
And apparently it is out
To be continued ....
Change class MFT_INPUT_STREAM_INFO to struct
Ok
Well I overcome my initial problem of this discussion. :-)
Obviously must be in this order ::
1) Create MediaType
2) SetInputType, SetOutputType
3) SampleIn -> MediaBuffer + Edit SetSampleDuration & SetSampleTime
4) ProcessMessage
5) ProcessInput
6) ProcessOuput
7) Read SampleOut
I have a routine that works (well there is no error)I need to check a few points.
OuffffffI managed to make a routine that works IMFTransform
Remains to the integrated
(For the moment the routine generates a 1KHz sine 1Second and save to a file Resampler)
How is WinRT support efforts going? I downloaded the project and it looks like there's been some progress. Would it be worthwhile for me to fork and do some work?
small complement
// MediaFoundationHelper.cspublicstatic WaveFormat CreateWaveFormatFromMediaType(IMFMediaType mediatype) { WaveFormat wF;int pcbSize = 0; MediaFoundationInterop.MFCreateWaveFormatExFromMFMediaType(mediatype, out wF, out pcbSize);return (WaveFormat)wF; }// Modify in MediaFoundationInterop.cs///<summary>/// Converts a Media Foundation audio media type to a WAVEFORMATEX structure.// </summary>/// TODO: try making second parameter out WaveFormatExtraData [DllImport("mfplat.dll", ExactSpelling = true, PreserveSig = false)]internalstaticexternvoid MFCreateWaveFormatExFromMFMediaType ( IMFMediaType pMFType,out WaveFormat wf,outint pcbSize,int flags = 0 );
Hi tcl,
Did you see my recent blog post on adding Windows Store support to NAudio? I'm actively working on it at the moment, but there is some way to go. Here's the key tasks that need to be completed.
1. Media Foundation. This is because ACM and DMO which NAudio already supported are both not allowed in Windows Store apps. The main three things we need are a MediaFoundationReader (which is mostly complete, just needs some tweaks), a MediaFoundationEncoder (which I have prototyped the internals of, just need to give it a nice public API), and a MediaFoundationResampler, which another forum user Manu is kindly helping out with, so hopefully there will be enough Media Foundation interop in the very near future.
2. WASAPI. Even though I have already done all the hard work on WASAPI interop, it will need to be modified to work with Windows Store apps. Currently I've not decided whether to make completely separate WasapiOut and WasapiIn classes for the Win8. I don't know whether loopback capture is possible. There is a great article on CodeProject showing how it can be done (in VB), so I'm hoping that when I get onto this in the very near future, it should be done quite quickly.
3. Streams NAudio depends heavily on the Stream base class, but the WinRT API now seems to prefer IInputStream, IOutputStream and IRandomAccessStream. There are a lot of classes (e.g. the WaveFileReader, WaveFileWriter, MP3FileReader, AiffFileReader, AiffFileWriter) that will at least need new constructors. I don't really want to have to maintain two completely separate versions of all these classes, so one interesting task will be to see what the simplest change that allows them to be used with the regular Windows Store file APIs is.
4. Demo Project I'm also going to create a Windows Store demo app. It will follow a similar structure to the WPF and WinForms ones, allowing me to very quickly add in new demos. Before we announce WinRT support we need two main demos. One reads files using MediaFoundationPlayer and plays them through WASAPI, and the other records from the microphone and encodes to WMA/MP3 using the MediaFoundationEncoder. I'll probably throw in some visualisation like waveform drawing as well. Once I've got the basic demo store app's structure in place, it should be easy for people to contribute other WinRT demos to it.
If you want to contribute, the best way at the moment is probably to prototype a proof of concept for one of these tasks, since the overall project is still very fluid and so I may not be able to merge in large contributions. Let me know if there is anything above that takes your interest.
hi Manu, thanks for this,although I think you may need to use WaveFormatExtraData in the function prototype, or you could end up missing the extra bytes. CreateWaveFormatFromMediaType should still return a WaveFormat though.
Mark