0

In reference to this question: NoDriver calling acmFormatSuggest on Azure

My hosting server does not allow me to install anything or register dlls. I am using Naudio to mix to mp3 files and it gave me the error NoDriver calling acmFormatSuggest.

I downloaded and installed Nlayer in my application and modified the code to look like this:

var builderBackground = new Mp3FileReader.FrameDecompressorBuilder(wf => new Mp3FrameDecompressor(wf)); 
var builderMessage = new Mp3FileReader.FrameDecompressorBuilder(wf => new Mp3FrameDecompressor(wf)); 
Mp3FileReader mpbacground = new Mp3FileReader(ThumbAudioMP3, builderBackground); Mp3FileReader mpMessage = new Mp3FileReader(stream, builderMessage); 
background = WaveFormatConversionStream.CreatePcmStream(mpbacground); 
message = WaveFormatConversionStream.CreatePcmStream(mpMessage);

var mixer = new WaveMixerStream32(); var messageOffsetted = new WaveOffsetStream(message, TimeSpan.FromSeconds(0), TimeSpan.Zero, TimeSpan.FromSeconds(seconds));

I get the same NoDriver calling acmFormatSuggest error in the line WaveFormatConversionStream.CreatePcmStream(...

Can someone tell me how I should be doing this? Any documentation on Nlayer?

Tupac
  • 647
  • 12
  • 37
devpav
  • 1
  • 1

1 Answers1

0

You don't need the WaveFormatConversionStream.CreatePcmStream lines. The Mp3FileReader classes will already emit PCM.

Mark Heath
  • 48,273
  • 29
  • 137
  • 194
  • Thanks for the reply but I am not sure I follow. The following code works but not in the server: Mp3FileReader mpbacground = new Mp3FileReader(ThumbAudioMP3, wave => new DmoMp3FrameDecompressor(wave)); Mp3FileReader mpMessage2 = new Mp3FileReader(stream, wave => new DmoMp3FrameDecompressor(wave)); var mixer = new WaveMixerStream32(); var backgroundOffsetted = new WaveOffsetStream(mpbacground, TimeSpan.FromSeconds(0), TimeSpan.Zero, TimeSpan.FromSeconds(60)); Using the NLayer Decompressor I get an error in WaveOffsetStream: Only PCM supported – devpav Jun 28 '17 at 00:21
  • Perhaps you can give me a code sample or point me in the right direction? I'm stock with this issue not being able to mix the mp3 files. Thanks in advance! – devpav Jul 03 '17 at 15:07
  • I haven't been able to find a solution. Media Foundation is also not installed in the server. All I need to do is to take two Mp3 files and merge them together. Is there a way to do this using the NLayer compresor? Can you provide me with a code sample? I would greatly appreciate the help! – devpav Jul 06 '17 at 18:31
  • I got one step further with this code: `code` var builderMessage = new Mp3FileReader.FrameDecompressorBuilder(wf => new Mp3FrameDecompressor(wf)); Mp3FileReader mpbacground = new Mp3FileReader(ThumbAudioMP3, builderMessage); Mp3FileReader mpMessage = new Mp3FileReader(stream, builderMessage); var mixer = new MixingSampleProvider(mpbacground.WaveFormat); mixer.AddMixerInput(mpbacground); mixer.AddMixerInput(mpMessage); WaveFileWriter.CreateWaveFile16(fullPath, mixer);`code` But now how do I trim the files to 60 seconds and resample them? How can I use WdlResamplingSampleProvider? – devpav Jul 10 '17 at 19:46