<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hello,</p>
<p><br>
</p>
<p>I'm trying to encode a raw audio file (16kHz or 22050Hz, stereo) in an ogg file by using vorbis-java library. </p>
<p><br>
</p>
<p>I always obtain an error when calling:</p>
<p><br>
</p>
<p><span>encoder.vorbis_encode_init_vbr( vorbisInfo, 2, 22050, 1);</span><br>
</p>
<p><span><br>
</span></p>
<p><span>The error is:</span></p>
<p><span><br>
</span></p>
<p><span></p>
<div>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1</div>
<div><span style="white-space:pre"></span>at org.xiph.libvorbis.vorbisenc.get_setup_template(vorbisenc.java:321)</div>
<div><span style="white-space:pre"></span>at org.xiph.libvorbis.vorbisenc.vorbis_encode_setup_vbr(vorbisenc.java:65)</div>
<div><span style="white-space:pre"></span>at org.xiph.libvorbis.vorbisenc.vorbis_encode_init_vbr(vorbisenc.java:82)</div>
<div><span style="white-space:pre"></span>at Vorbis.encode(Vorbis.java:390)</div>
<div><span style="white-space:pre"></span>at Vorbis.main(Vorbis.java:510)</div>
<div><br>
</div>
As I understand the library doesn't work for frequency minor then 40000. </span>
<p></p>
<p><span><br>
</span></p>
<p><span>Is it correct? Is there another way to use that library to encode to other frequency? </span></p>
<p><span><br>
</span></p>
<p><span>Thank you in advance. </span></p>
<p><span><br>
</span></p>
<p>BR,</p>
<p>Lorenzo.</p>
</div>
<i><span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:black">Il contenuto di questa e-mail e degli eventuali allegati è rivolto unicamente alla persona o all'organizzazione cui è indirizzato e può contenere informazioni la
 cui riservatezza è tutelata. Se avete ricevuto questa e-mail per errore, siete pregati di non copiarla, di non inviarla ad altre persone e di non usare il suo contenuto o gli eventuali allegati in alcun modo. Vi preghiamo di informare il mittente e di cancellarla
 dal vostro sistema.<br>
<br>
<div style="height:0px; border-top:1px solid gray; border-bottom:0px; border-left:0px; border-right:0px; padding:0px 0px 0px 0px; margin:5px 0px 5px 0px; width:100%">
</div>
This email and any attachments may be confidential and the subject of legal professional privilege. Any disclosure, use, storage or copying of this email without the consent of the sender is strictly prohibited. Please notify the sender immediately if you are
 not the intended recipient and then delete the email from your inbox and do not disclose the contents to another person, use, copy or store the information in any medium.</span></i>
</body>
</html>