MFSampledSP is a free, better-than-nothing, Windows-7-or-later implementation of some of the javax.sound.sampled.spi interfaces. It is part of the SampledSP collection of javax.sound.sampled libraries. Its main purpose is to decode audio from various formats at high speed. Examples for supported formats are MP3 or AAC. That said, MFSampledSP supports all formats also supported by Microsoft's Media Foundation.
Note that unlike other providers, MFSampledSP always converts audio data on-the-fly into linear signed PCM. No other conversions are supported. This also means that AudioFormat objects should be interpreted with a grain of salt.
The easiest way to use MFSampledSP (other than simply using the jar) is to start a Maven project and introduce a MFSampledSP dependency.
To do so, add something like this to the dependencies section of your pom:
<dependency> <groupId>com.tagtraum</groupId> <artifactId>mfsampledsp</artifactId> <version>0.9.11</version> </dependency>
If Maven can't resolve this dependency, you might also want to add the following repository to the repositories section of your pom:
<repository> <id>beatunes</id> <name>beaTunes Repository</name> <url>https://www.beatunes.com/repo/maven2</url> </repository>
As long as the native library is in the same directory as the MFSampledSP jar, it will be picked up.
To use the library, simply use the javax.sound.sampled classes like you normally would.
MFSampledSP requires Windows 7 or later and Java 7 or later.
For a service provider implementation for macOS, based on Apple's CoreAudio, check out CASampledSP.
For a cross platform service provider implementation featuring free formats like FLAC, OGG, and MP3 take a look at FFSampledSP.