{"id":19078082,"url":"https://github.com/hendriks73/casampledsp","last_synced_at":"2025-06-29T06:06:54.398Z","repository":{"id":9232031,"uuid":"11049341","full_name":"hendriks73/casampledsp","owner":"hendriks73","description":"CoreAudio-based service provider for javax.sound.sampled.","archived":false,"fork":false,"pushed_at":"2024-09-27T10:08:22.000Z","size":2502,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-04-30T04:47:31.586Z","etag":null,"topics":["aac-audio","aac-decoder","apple-lossless","audio-library","coreaudio","decode-audio-files","java","java-library","m4a","macos","mp3","mp3-decoder"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hendriks73.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-06-29T08:52:12.000Z","updated_at":"2024-09-27T10:08:25.000Z","dependencies_parsed_at":"2024-09-18T11:46:37.295Z","dependency_job_id":"4800f857-5655-4303-868c-6ecfa6b634db","html_url":"https://github.com/hendriks73/casampledsp","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/hendriks73/casampledsp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendriks73%2Fcasampledsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendriks73%2Fcasampledsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendriks73%2Fcasampledsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendriks73%2Fcasampledsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hendriks73","download_url":"https://codeload.github.com/hendriks73/casampledsp/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hendriks73%2Fcasampledsp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262545032,"owners_count":23326659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aac-audio","aac-decoder","apple-lossless","audio-library","coreaudio","decode-audio-files","java","java-library","m4a","macos","mp3","mp3-decoder"],"created_at":"2024-11-09T02:05:26.921Z","updated_at":"2025-06-29T06:06:54.375Z","avatar_url":"https://github.com/hendriks73.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"README.md\n==========\n\n[![LGPL 2.1](https://img.shields.io/badge/License-LGPL_2.1-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.tagtraum/casampledsp-complete/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.tagtraum/casampledsp-complete)\n[![Build and Test](https://github.com/hendriks73/casampledsp/workflows/Build%20and%20Test/badge.svg)](https://github.com/hendriks73/casampledsp/actions)\n[![CodeCov](https://codecov.io/gh/hendriks73/casampledsp/branch/main/graph/badge.svg?token=H98FM0SKQL)](https://codecov.io/gh/hendriks73/casampledsp/branch/main)\n\n*CASampledSP* is an implementation of the\n[javax.sound.sampled](https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/sound/sampled/spi/package-summary.html)\nservice provider interfaces based on Apple's Core Audio library, supporting all its file formats (mp3, aac, ...).\nIt is part of the [SampledSP](https://www.tagtraum.com/sampledsp.html) collection of `javax.sound.sampled`\nlibraries.\n\nIts main purpose is to decode audio files or streams to signed\nlinear [PCM](https://en.wikipedia.org/wiki/Pulse-code_modulation).\n\n\nUsage Example\n-------------\n\nTo use the library with Maven, introduce the following dependency:\n          \n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.tagtraum\u003c/groupId\u003e\n  \u003cartifactId\u003ecasampledsp-complete\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\nNote that when opening a compressed file with *CASampledSP*, you still need to\nconvert to PCM in order to actually decode the file.\n\nHere's a simple example for how that's done for mp3 to wave: \n\n```java\npublic static void mp3ToWav(File mp3Data) throws UnsupportedAudioFileException, IOException {\n    // open stream\n    AudioInputStream mp3Stream = AudioSystem.getAudioInputStream(mp3Data);\n    AudioFormat sourceFormat = mp3Stream.getFormat();\n    // create audio format object for the desired stream/audio format\n    // this is *not* the same as the file format (wav)\n    AudioFormat convertFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, \n        sourceFormat.getSampleRate(), 16, \n        sourceFormat.getChannels(), \n        sourceFormat.getChannels() * 2,\n        sourceFormat.getSampleRate(),\n        false);\n    // create stream that delivers the desired format\n    AudioInputStream converted = AudioSystem.getAudioInputStream(convertFormat, mp3Stream);\n    // write stream into a file with file format wav\n    AudioSystem.write(converted, Type.WAVE, new File(\"C:\\\\temp\\\\out.wav\"));\n}\n```\n\nSee also [here](https://stackoverflow.com/a/41850901/942774).\n\n\nBuild\n-----\n\nYou can only build this library on macOS.\n\nTo do so, you also need:\n\n- Maven 3.0.5 or later, https://maven.apache.org/\n- Apple Command Line Tools, available via https://developer.apple.com/,\n  or XCode, https://developer.apple.com/xcode/\n- a JDK (to run Maven and get the JNI headers)\n- [Doxygen](http://www.doxygen.org), available via [MacPorts](https://www.macports.org) or [HomeBrew](https://brew.sh)\n\nOnce you have all this, you need to adjust some properties in the parent `pom.xml`.\nOr.. simply override them using `-Dname=value` notation. E.g. to point to your\nOracle JDK JNI headers, add e.g.\n\n    -Ddarwin.headers.jni=/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/include/\n\nto your mvn call. You might also need to change `mmacosx-version-min` and `isysroot`, if you\ndon't have an OS X 10.7 SDK installed.\n\nSo all in all, something like the following might work for you:\n\n    mvn -Ddarwin.headers.jni=/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home/include/ \\\n        -Dmmacosx-version-min=10.7 \\\n        -Disysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/ \\\n        clean install\n\n\nRelease Notes\n-------------\n\nYou can find the release notes/history [here](NOTES.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhendriks73%2Fcasampledsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhendriks73%2Fcasampledsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhendriks73%2Fcasampledsp/lists"}