I want to normalize PCM WAV files from client side(Silverlight). I am using ASP.NET MVC on the server side. And I found a C program here
https://neon1.net/prog/normalizer.html Does anyone know that if there are similar C# libraries that I can use开发者_JAVA百科 directly?
"Normalizing" audio files is generally not a great idea, since if there is just one sample at full volume, then it will have no effect. A better approach would be to run a dynamic range compressor on the audio.
In Skype Voice Changer I have written sample code that uses NAudio and passes audio through dynamic range compressors. However, as others have said, NAudio isn't directly usable in Silverlight due to interop. But you should be able to copy WaveFileReader, WaveFormat and WaveFileWriter out and compile them without needing to make too many code changes. Also, you won't be able to use the WaveBuffer mechanism for casting between arrays of bytes and shorts/floats, so you need to do the conversion the slow way (e.g. using BitConverter).
Some ideas (aside of trying NAudio or Bass.NET)
- Call the compiled c executable
- Compile it as a dll and use P/Invoke
- Convert the C code to c#
精彩评论