我使用下面的代码来混合波形文件
a
它指出错误'无法找到类型或命名空间MixingSampleProvider'。我已经添加了Naudio的参考并使用了
void Mixingfunction(List<string> inputFiles)
{
MixingSampleProvider mixer = new MixingSampleProvider(NAudio.Wave.WaveFormat.CreateIeeeFloatWaveFormat(44100, 1));
try
{
for (int y = 0; y < counter; y++)
{
audioFileReader = new AudioFileReader(inputFiles[y]);
mixer.AddMixerInput((ISampleProvider)audioFileReader);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
return;
}
if (flag == true)
{
mixer.AddMixerInput((ISampleProvider)sineWaveProvider);
}
SampleToWaveProvider mixer2 = new SampleToWaveProvider(mixer);
waveout.Init(mixer2);
waveout.Play();
}
使用 using NAudio;
using NAudio.Wave;
using NAudio.Wave.SampleProviders;
解决WaveIn
相同的问题。那么NAudio.Wave.WaveIn
的父层次结构是什么。
答案 0 :(得分:0)
它在 int width = 225;
int height = 160;
int size = width * height;
int[] pixelData = new byte[size];
for (int i = 0; i < size; i++) {
// pack 4 bytes into int for ARGB_8888
pixelData[i] = ((0xFF & (byte)255) << 24) // alpha, 8 bits
| ((0xFF & (byte)255) << 16) // red, 8 bits
| ((0xFF & (byte)0) << 8) // green, 8 bits
| (0xFF & (byte)0); // blue, 8 bits
}
Bitmap image = Bitmap.createBitmap(pixelData, width, height, Bitmap.Config.ARGB_8888);
因此请确保您使用的是最新的NAudio(1.7.3)