Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: Windows 8 WinRT Metro Style Support

$
0
0

Hi Mark,

Do you have any plan to release a WinRT version of NAudio? I am currently using NAudio 1.5 in my WinRT Javascript application to convert MP3 to WAV using Naudio. It works like a charm but unfortunately the application does not pass the appcert tool certification... The tool says that naudio.dll uses some APIs that are forbidden.

I am aware it is not on your priority list but I just check.

The other idea I have is to remove from naudio source all the methods and libraries not necessary in the methods I use. Here is what I do:

public static void ConvertMp3toPcm(string sourceFilename, string outputFileName, string pcmFilename)
        {
            if (string.IsNullOrEmpty(sourceFilename))
                throw new ArgumentNullException("sourceFilename");

            if (string.IsNullOrEmpty(outputFileName))
                throw new ArgumentNullException("outputFileName");

            if (string.IsNullOrEmpty(pcmFilename))
                throw new ArgumentNullException("pcmFilename");

                using (Mp3FileReader reader = new Mp3FileReader(sourceFilename))
                {
                    using (WaveStream waveStream = WaveFormatConversionStream.CreatePcmStream(reader))
                    {
                        WaveFileWriter.CreateWaveFile(outputFileName, waveStream);
                    }
                }

                //Re-encode the stream with a mono channel, 16bits and 16kHz
                using (WaveStream readWaveStream = new WaveFileReader(outputFileName))
                {
                    WaveFormat target = new WaveFormat(16000, 16, 1);

                    WaveFormatConversionStream monoStream = new WaveFormatConversionStream(target, readWaveStream);
                    WaveFileWriter.CreateWaveFile(pcmFilename, monoStream);

                }             
                    }

I don't know if the licensing of Naudio would allow me to do this. I have to check.

Thanks a lot,

Omid.


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>