-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WaveFormat cannot be set for WASAPI Loopback Capture #174
Comments
Unfortunately, WasapiCapture only supports capturing at the sample rate, channel count and bit depth the device is using. This is a limitation of WASAPI itself. So you must resample manually after capturing |
Actually i am new on this... is there any algorithm for that?.. i didn't find useful link on web for resample .. please help |
take a look at my article on input driven resampling, for one way to do this. |
code through exception
but when i write code like this.. it works ok
but output audio is very noisy.. |
voice is in slow motion(sound like aaauuooo.. ) with noise |
then you have the wrong waveformat. Unfortunately, the ACM resampler doesn't like working with IEEE float, so you'd manually convert to 16 bit mono before resampling to 8kHz |
i used soxi cmd without convert to another.. output is
and My code is
whats the wrong with code |
i follow these step... audio is in correct format..
2% noise when listen audio .. audio is almost correct |
looks about right. Noise floor will be a bit higher with 16 bit 8kHz. One way to troubleshoot is create a WAV file at each intermediate stage (e.g. one from sampleStream, then one from resamplingProvider etc). That way you can find out where signal quality is degraded |
above method disturb the samples.. i record the silence from youtube https://www.youtube.com/watch?v=R7D1f6U6TpU.. i run the app without resample (44100 to 8000), i just used SampleToWaveProvider16 and StereoToMonoProvider16 ... and output audio is perfect... |
well, you do get some loss of quality in downsampling. If there is a clicking in the audio that might be a problem of loss of resampler state or something. You could try using one of the other resamplers in NAudio like the WdlResampler |
No , There is no clicking in audio.. Here is my changed code...
ok i will try with WdlResampler.. |
you must have one resampler that you keep open for the whole time and use that to resample all blocks. Or you'll get discontinuities |
i am confused. |
|
Thanks, I will try this. |
I am just doing resample (44100 to 8000 and skiping stereo to mono). and audio is completely noise.. sound coming from left earphone and then half second silence, and then sound from right earphone(again same pattern) did i miss something??
i more thing soxi cmd show less informtion when i saved audio and downloaded file from internet show more field code that i used to save
|
you are confusing the length of buffers in bytes with the number of samples. In WaveInEventArgs you should use bytes recorded. Divide it by 4 to get number of samples, and then by 2 (assuming stereo) to get number of sample frames. |
I solved my problem my copied WdlResamplingSampleProvider class in my project and change constructor of class
It will be good if u make two constructor in WdlResamplingSampleProvider |
Did you solve that problem? |
I am trying to record from speaker (loopback recording) in sample rate-8000 and channel-1,
problem is code is recording in sample rate-44100 and channel-2, format..
when i add
it thrown exception
there is any way to record it in 16000,1 format..
actually i dont want it change after complete recording.. i want it at start time..
please help me on this
The text was updated successfully, but these errors were encountered: