jeet_shri

Distinguished
May 4, 2010
4
0
18,510
hello
i have developed a programme to capture audio from mic.
this programme works fine in xp-sp3 with sample rate8000.0 and atxp2 at 41100.0 but when i execute this progamme on windows 7 .it crashes with exception .
can anyone tell me sample rate of audio formate fopr windows 7.
 

Kewlx25

Distinguished
Vista/7 have a different audio API than XP. It's suppose to transparently work for *most* programs since they justs re-did the old-APIs to convert and redirect to the new APIs.

The actual format that Vista/7 handle is 32bit floats at whatever the the hardware sampling rate is.

Vista/7 converts ALL audio to 32bit floats before processing.

There are new APIs that can give you direct control of the soundcard is you want, but your software would have to gain exclusive control and you have to handle ALL of the sound processing yourself as you then have direct control over the raw memory buffer.
 

jeet_shri

Distinguished
May 4, 2010
4
0
18,510




thanks Kewlx25

but i am still unable to get the solution . as per your suggestion if vista/7 automatically convert sound into 32 bit float and indpendent of hardware sampling then my code sholud be execute on win-7. but it is not so.
can you please give some more deatiled hints.
my configuration is below:

float sampleRate = 8000.0F; //xp-sp3

int sampleSizeInBits = 16;

int channels = 2;

boolean signed = true;

boolean bigEndian = false;

with best regards
jeet