This project has moved and is read-only. For the latest updates, please go here.

Audio Recording

Aug 6, 2012 at 10:34 AM

Is this possible to record the already playing audio in system...?

 

Aug 6, 2012 at 2:16 PM

you can do this with WASAPI loopback capture

Aug 7, 2012 at 8:14 AM

ya through WASAPI loopback capture its fine...but Audio format is not correct

if i use WaveIn its recording and Audio format is also correct,but Volume is very low while playing....

Aug 7, 2012 at 10:09 AM

WASAPI will only record at the format the soundcard is using. If it is not the sample rate you want then you have to resample manually.

Aug 7, 2012 at 11:14 AM

sorry, how can i Resample manually ...?

i tryed like this....

outputfile is the name of audio recorded using WasApi loopback method.

 

WaveFileReader Reader = new WaveFileReader(outputfile);

 

 

WaveFormat

 

 

TargetFormat = new WaveFormat();

 

 

WaveStream convertedStream;

TargetFormat =

WaveFormat.CreateCustomFormat(WaveFormatEncoding.Pcm,44100, 2, 176400, 4, 16);

 

convertedStream =

new WaveFormatConversionStream(TargetFormat, Reader); 

 

 

WaveFileWriter.CreateWaveFile(CompresedFileName, convertedStream);

convertedStream.Dispose();

 

 

 but getting the error "AcmNotPossible calling acmStreamOpen"

Aug 7, 2012 at 11:16 AM

what is Reader.WaveFormat?

Aug 7, 2012 at 12:59 PM

 Reader.WaveFormat.

  •   AverageBytesPerSecond :352800
  •   BitsPerSample:32
  •   BlockAlign:8
  •   Chanels:2
  •   ExtraSize:22
  •   SAmpleRate:44100
  •   Encoding:Extensible
Aug 7, 2012 at 2:54 PM

the ACM codec that does the format conversion doesn't like extensible, so the reader format passed in should be a regular WaveFormat(44100,16,2). You could create a very simple IWaveProvider implementor that replaces the WaveFormat with one of your choosing and passes on Read to the underlying source

Mark

Dec 29, 2012 at 4:31 AM
markheath wrote:

the ACM codec that does the format conversion doesn't like extensible, so the reader format passed in should be a regular WaveFormat(44100,16,2). You could create a very simple IWaveProvider implementor that replaces the WaveFormat with one of your choosing and passes on Read to the underlying source

Mark


Can you please elaborate a bit more. I am sorry I am new to this. thank you.