CASampledSP Native Library (arm64)

arm64 library for CASampledSP.

License

License

GroupId

GroupId

com.tagtraum
ArtifactId

ArtifactId

casampledsp-arm64
Last Version

Last Version

0.9.24
Release Date

Release Date

Type

Type

dylib
Description

Description

CASampledSP Native Library (arm64)
arm64 library for CASampledSP.
Project Organization

Project Organization

tagtraum industries incorporated

Download casampledsp-arm64

Dependencies

compile (1)

Group / Artifact Type Version
com.tagtraum : casampledsp-java jar 0.9.24

provided (1)

Group / Artifact Type Version
org.apache.ant : ant jar 1.9.15

test (1)

Group / Artifact Type Version
junit : junit jar 4.10

Project Modules

There are no modules declared in this project.

README.md

LGPL 2.1 Maven Central Build and Test CodeCov

CASampledSP is an implementation of the javax.sound.sampled service provider interfaces based on Apple's Core Audio library, supporting all its file formats (mp3, aac, ...). It is part of the SampledSP collection of javax.sound.sampled libraries.

Its main purpose is to decode audio files or streams to signed linear pcm.

This library comes with absolutely no support, warranty etc. you name it.

Binaries and more info can be found at its tagtraum home.

Usage Example

To use the library with Maven, introduce the following dependency:

<dependency>
  <groupId>com.tagtraum</groupId>
  <artifactId>casampledsp-complete</artifactId>
</dependency>

Note that when opening a compressed file with CASampledSP, you still need to convert to PCM in order to actually decode the file.

Here's a simple example for how that's done for mp3 to wave:

public static void mp3ToWav(File mp3Data) throws UnsupportedAudioFileException, IOException {
    // open stream
    AudioInputStream mp3Stream = AudioSystem.getAudioInputStream(mp3Data);
    AudioFormat sourceFormat = mp3Stream.getFormat();
    // create audio format object for the desired stream/audio format
    // this is *not* the same as the file format (wav)
    AudioFormat convertFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 
        sourceFormat.getSampleRate(), 16, 
        sourceFormat.getChannels(), 
        sourceFormat.getChannels() * 2,
        sourceFormat.getSampleRate(),
        false);
    // create stream that delivers the desired format
    AudioInputStream converted = AudioSystem.getAudioInputStream(convertFormat, mp3Stream);
    // write stream into a file with file format wav
    AudioSystem.write(converted, Type.WAVE, new File("C:\\temp\\out.wav"));
}

See also here.

Build

You can only build this library on macOS.

To do so, you also need:

Once you have all this, you need to adjust some properties in the parent pom.xml. Or.. simply override them using -Dname=value notation. E.g. to point to your Oracle JDK JNI headers, add e.g.

-Ddarwin.headers.jni=/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/include/

to your mvn call. You might also need to change mmacosx-version-min and isysroot, if you don't have an OS X 10.7 SDK installed.

So all in all, something like the following might work for you:

mvn -Ddarwin.headers.jni=/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/include/ \
    -Dmmacosx-version-min=10.7 \
    -Disysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/ \
    clean install

Enjoy.

https://www.tagtraum.com/casampledsp/

Versions

Version
0.9.24