Skip to content

Commit

Permalink
Merge branch 'windows-24bit'
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstadler committed Sep 12, 2023
2 parents 5cc94f4 + fb52213 commit 82d1557
Show file tree
Hide file tree
Showing 7 changed files with 267 additions and 90 deletions.
6 changes: 3 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/processing-core.zip"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="lib" path="library/processing-core.zip"/>
<classpathentry kind="lib" path="library/javamp3-1.0.4.jar"/>
<classpathentry kind="lib" path="library/jsyn-17.1.0.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/android.jar"/>
<classpathentry kind="lib" path="library/junit-4.12.jar"/>
<classpathentry kind="lib" path="library/android.jar"/>
<classpathentry kind="lib" path="test/**/*.class"/>
<classpathentry kind="output" path="bin"/>
</classpath>
31 changes: 27 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,24 @@
<available file="library/javamp3-1.0.4.jar" property="hasjavamp3" />
</target>

<target name="bundled-deps" depends="check-bundled-deps" unless="hasjsyn" description="Download JSyn and JavaMP3">
<target name="bundled-deps" depends="check-bundled-deps" unless="hasjsyn" description="Download JSyn, JavaMP3 and (J)PortAudio">
<get src="https://github.com/philburk/jsyn/releases/download/v17.1.0/jsyn-17.1.0.jar" dest="library/" usetimestamp="true" />
<get src="https://github.com/kevinstadler/JavaMP3/releases/download/v1.0.4/javamp3-1.0.4.jar" dest="library/" usetimestamp="true" />

<get src="https://www.softsynth.com/jsyn/developers/archives/jportaudio_pc_20120904.zip" dest="library/" usetimestamp="true" />
<unzip src="${lib}/jportaudio_pc_20120904.zip" dest="${lib}">
<patternset>
<include name="**/*.jar" />
</patternset>
<mapper type="flatten"/>
</unzip>
<unzip src="${lib}/jportaudio_pc_20120904.zip" dest="${lib}/windows-amd64/">
<patternset>
<include name="**/*_x64.dll" />
</patternset>
<mapper type="flatten"/>
</unzip>
<delete file="${lib}/jportaudio_pc_20120904.zip" />
</target>

<target name="deps" description="Get library dependencies">
Expand Down Expand Up @@ -95,13 +110,21 @@
<include name="LICENSE" />
<include name="README.md" />
<include name="examples/**" />
<include name="library/sound.jar" />
<include name="library/jsyn-17.1.0.jar" />
<include name="library/javamp3-1.0.4.jar" />
<include name="library.properties" />
<include name="library/*.jar" />
<!-- all files inside per-architecture directories - real dlls and dummy files -->
<include name="library/*-*/*" />

<exclude name="library/android.jar" />
<exclude name="library/junit-*" />
<exclude name="library/hamcrest-*" />
</patternset>

<target name="dist" depends="clean,jar,javadoc" description="Build clean Sound library zip">
<touch mkdirs="true" file="${lib}/linux-aarch64/dummy" />
<touch mkdirs="true" file="${lib}/linux-amd64/dummy" />
<touch mkdirs="true" file="${lib}/linux-arm/dummy" />
<touch mkdirs="true" file="${lib}/macos-x86_64/dummy" />
<zip destfile="../sound.zip">
<zipfileset dir="." prefix="sound">
<patternset refid="dist.files" />
Expand Down
25 changes: 25 additions & 0 deletions examples/IO/LowLevelEngine/LowLevelEngine.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import processing.sound.*;

import com.jsyn.devices.*;
import com.jsyn.Synthesizer;
import com.jsyn.devices.jportaudio.JPortAudioDevice;

void setup() {

// get hardware device information
Sound.list();

AudioDeviceManager m = Sound.getAudioDeviceManager();
println("Audio device manager: " + m);
if (m instanceof JPortAudioDevice) {
println("Using the PortAudio device for 24 bit support on Windows");
}


// get synthesis runtime information
Synthesizer s = Sound.getSynthesizer();
// a lot of this information can be gleaned with one look by calling Sound.status();
println("Current CPU usage: " + s.getUsage());

}

2 changes: 1 addition & 1 deletion src/processing/sound/AudioIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public AudioIn(PApplet parent, int in) {
// TODO check if the current input device actually has 'in' input channels,
// otherwise an ugly exception is thrown

if (Engine.getAudioDeviceManager() instanceof JSynAndroidAudioDeviceManager) {
if (Engine.getEngine().getAudioDeviceManager() instanceof JSynAndroidAudioDeviceManager) {
if (in != 0) {
Engine.printWarning("if you want to capture audio from somewhere other than the default\n" +
"device on Android, use: new Sound(this).inputDevice(deviceID)\n" +
Expand Down
Loading

0 comments on commit 82d1557

Please sign in to comment.