Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sound sample rate for window xp sp2

843802May 4 2010 — edited May 4 2010
hello,

i have developed an audio recorder programme for recording sound in wave formate
with following Audio Formate


float sampleRate = 8000.0F;

int sampleSizeInBits = 16;

int channels = 1;

boolean signed = true;

boolean bigEndian = false;

return new AudioFormat(sampleRate,
sampleSizeInBits,
channels,
signed,
bigEndian);

above code return a audio formate object .
after recording i have megerd this file my .mov files by a merging programe .
this works fine when i execute this code on windows xp service pack-3
but
when i tried to run this code on xp-sp2 or on windows -7 it gives null pinter Exception in folling line

AudioSystem.getLine(dataLineInfo);

following error is occured related to audio formate


java.lang.IllegalArgumentException: No line matching interface TargetDataLine supporting format PCM_SIGNED 8000.0 Hz, 16 bit, mono, 4 bytes/frame, little-endian is supported.
at javax.sound.sampled.AudioSystem.getLine(Unknown Source)


now i think it is the problem related to audio formate supported by various version of xp...
can any one tell me what is the audio formate credentials for xp-sp2 and for windows -7


thanks

jitendra shrivatava
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2010
Added on May 4 2010
2 comments
430 views