Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe the accepted answer answers another question -- it solves the same problem (downsampling the audio) but in another way (manually in stead of using the java sound API). I had the same thing and dug into it.</p> <p>The correct way (or java sound API way) to do this is indeed (as suggested in <a href="http://docs.oracle.com/javase/tutorial/sound/converters.html">http://docs.oracle.com/javase/tutorial/sound/converters.html</a>)</p> <pre><code>AudioFormat outDataFormat = new AudioFormat((float) 8000.0, (int) 8, (int) 1, true, false); AudioInputStream lowResAIS = AudioSystem.getAudioInputStream(outDataFormat, inFileAIS); </code></pre> <p>Problem is that standard java doesn't ship with resampling (or even stereo-mono conversion) code (or at least not in that part of the code -- see <a href="http://www.jsresources.org/faq_audio.html#convert_sample_rate">http://www.jsresources.org/faq_audio.html#convert_sample_rate</a>).</p> <p>The jsresources pages point to the answers as well: simply installing 2 plugins does the trick. Easiest is to install these plugins in the Extensions directory, on OSX Lion this will do the trick (provided you have wget):</p> <pre><code>wget http://www.tritonus.org/tritonus_share-0.3.6.jar -O /Library/Java/Extensions/tritonus_share-0.3.6.jar wget http://www.tritonus.org/tritonus_remaining-0.3.6.jar -O /Library/Java/Extensions/tritonus_remaining-0.3.6.jar </code></pre> <p>After adding these 2 jar files, everything worked (just one extra warning: if you want to change both the number of channels and the sample rate, it's still not supported as one step).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload