Fork me on GitHub


PCMSampledSP is a free implementation of some javax.sound.sampled.spi interfaces. Its main purpose is to re-sample PCM audio to different sampling rates using polyphase decomposition and a multi-step approach. Additionally, it supports changing a signal's bit depth.

Getting Started

The easiest way to use PCMSampledSP (other than simply using the jar) is to start a Maven project and introduce a PCMSampledSP dependency.

To do so, add something like this to the dependencies section of your pom:


If Maven can't resolve this dependency, you might also want to add the following repository to the repositories section of your pom:

    <name>beaTunes Repository</name>

To use the library, simply use the javax.sound.sampled classes like you normally would.


To re-sample a 44.1kHz wave file to 48kHz, you could write something like this:

final File file = new File("Some44100HzFile.wav");
final AudioInputStream sourceStream = AudioSystem.getAudioInputStream(file);
final AudioFormat sourceFormat = sourceStream.getFormat();
final AudioFormat targetFormat = new AudioFormat(
        48000f, // target sample rate
        48000f, // target frame rate
final AudioInputStream resampledStream = AudioSystem.getAudioInputStream(targetFormat, sourceStream);
// do something with the resampled audio data
AudioSystem.write(resampledStream, AudioFileFormat.Type.WAVE, new File("Resampled48000HzFile.wav"));


PCMSampledSP is written in pure Java. It does not require any native libraries.