-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Since doing the recent SDK update in Processing for Android:
The Sound Library is no longer functioning in Android mode. I get this error:
java.lang.UnsupportedOperationException: Cannot create AudioRecord
at android.media.AudioRecord$Builder.build(AudioRecord.java:626)
at processing.sound.JSynAndroidAudioDeviceManager$AndroidAudioInputStream.start(Unknown Source:66)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(Unknown Source:29)
I installed Processing 3 on 2 windows 10 PCs and a windows 7 PC and received the same error.
As a test I tried the “SimplePlayback” Processing 3 Sound example.
It worked in JAVA mode; giving this INFO:
Jun 11, 2019 12:32:42 PM com.jsyn.devices.javasound.JavaSoundAudioDevice
INFO: JSyn: default output latency set to 80 msec for Windows 10
Here is the sketch, slightly modified:
import processing.sound.*;
SoundFile soundfile;
void setup() {
//fullScreen();
size(640, 360);
background(255);
soundfile = new SoundFile(this, “vibraphon.aiff”);
println(“SFSampleRate= " + soundfile.sampleRate() + " Hz”);
println(“SFSamples= " + soundfile.frames() + " samples”);
println(“SFDuration= " + soundfile.duration() + " seconds”);
soundfile.loop();
}
void draw() {
float playbackSpeed = map(mouseY, 0, width, 0.25, 4.0);
soundfile.rate(playbackSpeed);
float panning = map(mouseX, 0, width, -1.0, 1.0);
soundfile.pan(panning);
}
void mouseDragged(){
float amplitude = map(mouseY, 0, height, 0.2, 1.0);
soundfile.amp(amplitude);
}
I should mention that other than no sound, in Android mode, the apps work fine. I've been using the Sound library for months in Android mode with no issues until my recent use of the SDK Updater in Processing for Android.
Can you help me?