diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c8063c3..c42152a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -18,6 +18,10 @@ jobs: analyze: name: Analyze runs-on: macos-14 + permissions: + actions: read + contents: read + security-events: write strategy: fail-fast: false @@ -34,7 +38,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -59,4 +63,4 @@ jobs: GITHUB_TOKEN: ${{ github.token }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/README.md b/README.md index 8e0e2db..a279431 100644 --- a/README.md +++ b/README.md @@ -7,45 +7,45 @@ 🌏 play the world ♪ -## Status +### Status | **SPI** | **Codec** | **IN Status** | **OUT Status** | **SPI Status** | **project** | **Description** | **Comment** | |:------------|:-------------|:--------------|:---------------|:---------------|:---------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------| -| midi | unknown | 🚫 | 🚫 | - | this | MFi by [unknown]() | | -| midi | ittake | 🚫 | 🚫 | - | this | MFi by [ittake](https://web.archive.org/web/20090515001654/http://tokyo.cool.ne.jp/ittake/java/MIDIToMLDv013/MIDIToMLD.html) | | -| sampled | ilbc | 🚫 | 🚫 | - | this | [c](http://www.ilbcfreeware.org/) | | -| sampled | ldcelp | 🚫 | 🚫 | - | this | [c](ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/coding/ldcelp-2.0.tar.gz) | | -| sampled | mp3 | 🚫 | - | - | this | [mp3](https://github.com/umjammer/vavi-sound-sandbox/tree/master/src/main/java/vavi/sound/mp3) | need to deal tags | -| sampled | mp3 | ✅ | - | ✅ | [mp3spi](https://github.com/umjammer/mp3spi) | [jlayer](https://github.com/umjammer/jlayer) | | -| sampled | sse | 🚫 | - | 🚫 | this | [sse](http://shibatch.sourceforge.net/download/) | | -| sampled | resampling | ✅ | - | - | this | [laoe](http://www.oli4.ch/laoe/home.html) | | -| sampled | resampling | ✅ | - | - | this | [rohm](https://en.wikipedia.org/wiki/Rohm) | | -| sampled | polyphase | ✅ | - | 🚧 | this | [sox](http://sox.sourceforge.net/) resampling | | -| sampled | resampler | ✅ | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | -| sampled | perfect | 🚧 | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | -| sampled | monauralize | ✅ | - | ✅ | [tritonus-remaining](https://github.com/umjammer/tritonus-remaining) | `PCM2PCMConversionProvider` | works but not suitable for resampling | -| sampled | ~~alac~~ | ✅ | - | ✅ | [vavi-sound-alac](https://github.com/umjammer/vavi-sound-alac) | | graduated to vavi-sound-alac | -| ~~sampled~~ | ~~QTKit~~ | ~~✅~~ | - | ? | ~~this~~ | ~~[rococoa](https://github.com/umjammer/rococoa)~~ | deprecated | -| sampled | AVFoundation | 🚧 | - | 🚧 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioConverter` how to return objc value in callback? | -| sampled | twinvq | 🚫 | 🚫 | - | this | | TODO use ffmpeg | -| midi | vsq | 🚧 | - | 🚧 | this | | YAMAHA Vocaloid | -| sampled | opus | ✅ | 🚫 | ✅ | this | [concentus](https://github.com/lostromb/concentus) | | -| midi | AudioUnit | ✅ | - | ✅ | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitMIDIInstrument/kAudioUnitSubType_DLSSynth` | -| midi | AudioUnit | ✅ | - | 🚫 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitSampler`, how to adjust sf2 patch? | -| midi | JSyn | ✅ | - | ✅ | this | [JSyn](https://github.com/philburk/jsyn) | looking for good drums | -| midi | OPL3 | ✅ | - | ✅ | this | [adplug](https://github.com/adplug/adplug) | [opl3-player](http://opl3.cozendey.com/) | -| midi | ? | - | - | - | this | | opl, ma | -| midi | CoreMIDI | ✅ | ? | ✅ | [osxmidi4j](https://github.com/umjammer/osxmidi4j) | rococoa | iac ✓, network ✓, bluetooth ? | -| midi | CoreMIDI | ✅ | ? | ✅ | [CoreMidi4J](https://github.com/DerekCook/CoreMidi4J) | jni | iac ✓, network ✓, bluetooth ? | -| sampled | speex | ✅ | - | ✅ | [jspeex](http://jspeex.sourceforge.net/) | | sample rate is limited to convert | -| sampled | flac | ✅ | - | ✅ | [JustFLAC](https://github.com/umjammer/vavi-sound-flac) | | | -| sampled | flac | ✅ | - | ✅ | [jFLAC](http://jflac.sourceforge.net/) | | | -| sampled | aac | - | - | ✅ | [JAADec](https://github.com/umjammer/vavi-sound-aac) | | | -| sampled | vorbis | - | - | ✅ | [tritonus-jorbis](https://github.com/umjammer/tritonus-jorbis) | | | -| sampled | atrac3 | 🚧 | - | 🚧 | this | jpcsp | Sony MD | -| sampled | atrac3+ | 🚧 | - | 🚧 | this | jpcsp | Sony MD | - -## Features +| midi | unknown | 🚫 | 🚫 | - | this | MFi by [unknown]() | | +| midi | ittake | 🚫 | 🚫 | - | this | MFi by [ittake](https://web.archive.org/web/20090515001654/http://tokyo.cool.ne.jp/ittake/java/MIDIToMLDv013/MIDIToMLD.html) | | +| sampled | ilbc | 🚫 | 🚫 | - | this | [c](http://www.ilbcfreeware.org/) | | +| sampled | ldcelp | 🚫 | 🚫 | - | this | [c](ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/coding/ldcelp-2.0.tar.gz) | | +| sampled | mp3 | 🚫 | - | - | this | [mp3](https://github.com/umjammer/vavi-sound-sandbox/tree/master/src/main/java/vavi/sound/mp3) | need to deal tags | +| sampled | mp3 | ✅ | - | ✅ | [mp3spi](https://github.com/umjammer/mp3spi) | [jlayer](https://github.com/umjammer/jlayer) | | +| sampled | sse | 🚫 | - | 🚫 | this | [sse](http://shibatch.sourceforge.net/download/) | | +| sampled | resampling | ✅ | - | - | this | [laoe](http://www.oli4.ch/laoe/home.html) | | +| sampled | resampling | ✅ | - | - | this | [rohm](https://en.wikipedia.org/wiki/Rohm) | | +| sampled | polyphase | ✅ | - | 🚧 | this | [sox](http://sox.sourceforge.net/) resampling | | +| sampled | resampler | ✅ | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | +| sampled | perfect | 🚧 | - | - | this | [sox](http://sox.sourceforge.net/) resampling | | +| sampled | monauralize | ✅ | - | ✅ | [tritonus-remaining](https://github.com/umjammer/tritonus-remaining) | `PCM2PCMConversionProvider` | works but not suitable for resampling | +| sampled | ~~alac~~ | ✅ | - | ✅ | [vavi-sound-alac](https://github.com/umjammer/vavi-sound-alac) | | graduated to vavi-sound-alac | +| ~~sampled~~ | ~~QTKit~~ | ~~✅~~ | - | ? | ~~this~~ | ~~[rococoa](https://github.com/umjammer/rococoa)~~ | deprecated | +| sampled | AVFoundation | 🚧 | - | 🚧 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioConverter` how to return objc value in callback? | +| sampled | twinvq | 🚫 | 🚫 | - | this | | TODO use ffmpeg | +| midi | vsq | 🚧 | - | 🚧 | this | | YAMAHA Vocaloid | +| sampled | opus | ✅ | 🚫 | ✅ | this | [concentus](https://github.com/lostromb/concentus) | | +| midi | AudioUnit | ✅ | - | ✅ | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitMIDIInstrument/kAudioUnitSubType_DLSSynth` | +| midi | AudioUnit | ✅ | - | 🚫 | this | [rococoa](https://github.com/umjammer/rococoa) | use `AVAudioUnitSampler`, how to adjust sf2 patch? | +| midi | JSyn | ✅ | - | ✅ | this | [JSyn](https://github.com/philburk/jsyn) | looking for good drums | +| midi | OPL3 | ✅ | - | ✅ | this | [adplug](https://github.com/adplug/adplug) | [opl3-player](http://opl3.cozendey.com/) | +| midi | ? | - | - | - | this | | opl, ma | +| midi | CoreMIDI | ✅ | ? | ✅ | [osxmidi4j](https://github.com/umjammer/osxmidi4j) | rococoa | iac ✓, network ✓, bluetooth ? | +| midi | CoreMIDI | ✅ | ? | ✅ | [CoreMidi4J](https://github.com/DerekCook/CoreMidi4J) | jni | iac ✓, network ✓, bluetooth ? | +| sampled | speex | ✅ | - | ✅ | [jspeex](http://jspeex.sourceforge.net/) | | sample rate is limited to convert | +| sampled | flac | ✅ | - | ✅ | [JustFLAC](https://github.com/umjammer/vavi-sound-flac) | | | +| sampled | flac | ✅ | - | ✅ | [jFLAC](http://jflac.sourceforge.net/) | | | +| sampled | aac | - | - | ✅ | [JAADec](https://github.com/umjammer/vavi-sound-aac) | | | +| sampled | vorbis | - | - | ✅ | [tritonus-jorbis](https://github.com/umjammer/tritonus-jorbis) | | | +| sampled | atrac3 | 🚧 | - | 🚧 | this | jpcsp | Sony MD | +| sampled | atrac3+ | 🚧 | - | 🚧 | this | jpcsp | Sony MD | + +### Features * ~~ALAC Java sound SPI~~ ... ([graduated incubation](https://github.com/umjammer/vavi-sound-alac)) * OPAS Java sound SPI ... (candidate to graduate) @@ -56,26 +56,46 @@ * OPL3 synthesizer Java MIDI SPI ... (wip) * [iTunes Library (rococoa) ... Music.app Music Database](https://github.com/umjammer/vavi-sound-sandbox/tree/master/src/main/java/vavix/rococoa/ituneslibrary) +### Tech Know + +* `tritonus-mp3` only supports mp3 w/o tags +* the reason we got "`javax.sound.midi.MidiUnavailableException: MIDI OUT transmitter not available`" is that `sound.jar` of `JMF` is in the class path. + ## Install * [maven](https://jitpack.io/#umjammer/vavi-sound-sandbox) -## Tech Know +## Usage - * `tritonus-mp3` only supports mp3 w/o tags - * the reason we got "`javax.sound.midi.MidiUnavailableException: MIDI OUT transmitter not available`" is that `sound.jar` of `JMF` is in the class path. +```java +AudioInputStream ais = AudioSystem.getAudioInputStream(Paths.get(opus).toFile()); +Clip clip = AudioSystem.getClip(); +clip.open(AudioSystem.getAudioInputStream(new AudioFormat(44100, 16, 2, true, false), ais)); +clip.loop(Clip.LOOP_CONTINUOUSLY); +``` ## References * [Gervill](https://github.com/bluenote10/gervill) * https://github.com/HectorRicardo/final-gervill * https://github.com/philfrei/AudioCue-maven + * https://github.com/jitsi/libjitsi + +### Lesson + + * [javaassist doesn't support *enhanced for*](https://github.com/jboss-javassist/javassist/issues/403#issuecomment-989827788) + * `com.sun.media.sound.SoftMidiAudioFileReader` has a bug that consumes 4 bytes and not releases (resets) those after examination ## TODO * ~~jni in maven~~ * ~~resampling spi~~ * ~~qt has been deprecated~~ + * volume enabled clip + * [mmscomputing](https://github.com/alex73/mmscomputing/blob/c666f63ec0b7f678aa3d05c1b2f63d748b743257/src/uk/co/mmscomputing/sound/provider/Clip.java#L12) + * 🎯 [playn](https://github.com/playn/playn/blob/3ad0d6bf22c3f7c0eb6d3497523d197f4c50a46b/java-base/src/playn/java/BigClip.java#L46) + * caf + * https://github.com/ruda/caf ### Library diff --git a/local.properties.sample b/local.properties.sample index bebdaf4..c75f5c3 100644 --- a/local.properties.sample +++ b/local.properties.sample @@ -1,4 +1,7 @@ opl3.test=/foo/bar/opl3.mid mocha.test=/foo/bar/mocha.mid jsyn.test=/foo/bar/jsyn.mid -clip.test=/foo/bar/jsyn.m4a \ No newline at end of file +clip.test=/foo/bar/jsyn.m4a + +vavi.test.volume=0.02 +vavi.test.volume.midi=0.2 diff --git a/pom.xml b/pom.xml index d972a55..1dbc71b 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ vavi vavi-sound-sandbox - 1.0.7 + 1.0.8 Vavi Sound API (Sandbox) https://github.com/umjammer/vavi-sound-sandbox @@ -23,11 +23,77 @@ com.github.umjammer.tritonus 0.3.13 - com.github.umjammer.rococoa - 0.8.7 VERBOSE + 0.02 + 0.2 + false + + + local + + + ${basedir}/local.properties + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.1.0 + + + read-properties + initialize + + read-project-properties + + + + ${basedir}/local.properties + + + + + + + + + + + uml + + + + plantuml-generator-maven-plugin + de.elnarion.maven + 1.1.2 + + + generate-simple-diagram + + generate + + + + javax-sound-diagram.txt + + + + + + + + + + + + + @@ -44,6 +110,9 @@ true true + + vavi/sound/twinvq/*.java + @@ -54,14 +123,74 @@ -Xmx4G - -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties - -Dvavi.test.volume=0.02 --add-exports java.desktop/com.sun.media.sound=ALL-UNNAMED + -javaagent:${project.build.directory}/vavi-instrumentation.jar + -Dvavix.lang.instrumentation.VaviInstrumentation.1=vavix.lang.instrumentation.PropertiesClassFileTransformer + -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties + -Dvavi.test.volume=${vavi.test.volume} + -Dvavi.test.volume.midi=${vavi.test.volume.midi} + -Dvavi.test.version=${project.version} false false + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + IntegrationTest + + run + + integration-test + + ${maven.test.skip} + + + + + + + + + + + true + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1 + + + copy + generate-test-resources + + copy + + + + + com.github.umjammer.vavi-commons + vavi-instrumentation + jar + false + ${project.build.directory} + vavi-instrumentation.jar + + + + + + @@ -70,6 +199,11 @@ jitpack.io https://jitpack.io + + maven_central + Maven Central + https://repo.maven.apache.org/maven2/ + @@ -77,7 +211,7 @@ org.junit junit-bom - 5.10.1 + 5.10.2 pom import @@ -88,12 +222,12 @@ com.github.umjammer vavi-commons - 1.1.10 + 1.1.12 com.github.umjammer vavi-sound - 1.0.16 + 1.0.18 com.github.umjammer @@ -103,14 +237,9 @@ - ${rococoa.groupId} + com.github.umjammer.rococoa rococoa-cocoa - ${rococoa.version} - - - ${rococoa.groupId} - rococoa-core - ${rococoa.version} + 0.8.13 ${tritonus.groupId} @@ -120,7 +249,7 @@ com.github.lostromb concentus - fdf276e + acaadf2075 pom @@ -215,13 +344,13 @@ com.github.umjammer vavi-sound-flac - 0.0.5 + 0.0.6 test com.github.umjammer vavi-sound-aac - 0.8.10 + 0.8.12 test mp3spi - 1.9.15 + 1.9.16 test @@ -243,7 +372,7 @@ org.slf4j slf4j-jdk14 - 2.0.5 + 2.0.13 test