Java Sound Resources: Examples: Audio Conversion

This page presents example that show how to encode audio data to ogg vorbis, mp3, GSM 06.10 and mu-law and how to decode or play such files. Additionally, sample rate conversion is demonstrated. The examples that utilize the package javax.sound.sampled.

AudioDecoder

Decoding an encoded audio file

AudioEncoder

Encoding an audio file

AudioConverter

Converting audio files to different encodings, sample size, channels, sample rate

DecodingAudioPlayer

Playing an encoded audio file

GSMEncoder

Encoding an audio file to GSM 06.10

Mp3Encoder

Encoding an audio file to mp3

SampleRateConverter

Converting the sample rate of audio files

UlawEncoder

Encoding an audio file to μ-law

SingleChannelStereoConverter

Converting mono to one channel of stereo