Open mithunvs opened 5 years ago
Please help
Yes, you can , there is an example in Samples named as RecordWithSepcificFormat , demoed to flexible format settings. But you know , WASAPI Loopback Recording only support the format alreay internal use, so if you really need to set format different to the system internal using , you have to convert it by yourself. Otherwise If you did that arbitrarily, you would get the bad audio quality results.
I tried to write samples of different wave format .When i am using WaveWriter.Write, I got clear audio but WaveWriter.Write does not take float values ,So I had to use the WaveWriter.WriteSamples but this time i got a different audio . I have to do this because I want to reduce the size of the audio captured by the wasapi loopback capture. Is there any way by which I can write samples with different format Here is my code : ` var soundIn = new WasapiLoopbackCapture(); soundIn.Initialize(); var soundInSource = new SoundInSource(soundIn); IWaveSource convertedSource = soundInSource .ChangeSampleRate(32000) // sample rate .ToSampleSource() .ToWaveSource(16); var notificationSource = new NotificationSource(soundInSource.ToSampleSource());