Comments (8)
I tried but could not reproduce this error. Maybe you have different devices.
Here is the output I get by running the attached file as a unit test.
java.version = 1.8.0_45, java.vendor = Oracle Corporation, os.arch = x86_64
INPUT device = 0, channels = 2
OUTPUT device = 0, channels = 2
Aug 01, 2016 8:52:13 AM com.jsyn.engine.SynthesisEngine start
INFO: Pure Java JSyn from www.softsynth.com, rate = 96000, RT, V16.7.5 (build 459, 2015-11-02)
2016-08-01 08:52:13.679 java[17005:13887572] 08:52:13.679 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
Aug 01, 2016 8:52:15 AM com.jsyn.engine.SynthesisEngine run
INFO: JSyn synthesis thread in finally code.
java.version = 1.8.0_45, java.vendor = Oracle Corporation, os.arch = x86_64
Aug 01, 2016 8:52:16 AM com.jsyn.engine.SynthesisEngine start
INFO: Pure Java JSyn from www.softsynth.com, rate = 96000, RT, V16.7.5 (build 459, 2015-11-02)
INPUT device = 0, channels = 2
OUTPUT device = 0, channels = 2
java.version = 1.8.0_45, java.vendor = Oracle Corporation, os.arch = x86_64
INPUT device = 0, channels = 2
OUTPUT device = 0, channels = 2
Aug 01, 2016 8:52:18 AM com.jsyn.engine.SynthesisEngine run
INFO: JSyn synthesis thread in finally code.
#0: Default Audio Device, 2 inputs, 2 outputs
#1: Built-in Microphone, 2 inputs, 0 outputs
#2: Built-in Output, 0 inputs, 2 outputs
#3: Port Built-in Microphone, 0 inputs, 0 outputs
#4: Port Built-in Output, 0 inputs, 0 outputs
BTW, I notice you have two calls to start() in your error log. I tried starting twice but it still worked.
from jsyn.
So the issue, I think, was in the 2nd call to start (in some cases, the engine apparently needed to be restarted, I'm not sure why), which used the following code:
Synth.stop();
Synth.start(flag, rate, inDevID, inDevChNum, outDevID, outDevChNum);
which appears to cause the NullPointerException. When I changed this code to:
Synth.stop();
Synth.terminate();
Synth.initialize();
Synth.start(flag, rate, inDevID, inDevChNum, outDevID, outDevChNum);
things again work ok...
from jsyn.
Thanks! I modified my test and can now reproduce the crash. It appears that JavaSound streams can take 1200 msec to close! But I was only waiting for 1000 msec. So there was a race condition.
Instead of start-stop-start-stop I has start-start-stop-stop.
The delayed stop() clobbered the stream created by the second start. I know how to fix this. Thanks for reporting it.
from jsyn.
Now I need to update the downloadable JAR files.
from jsyn.
The new JAR files are posted on the JSyn site. Please let me know if they fix the problem for you.
http://www.softsynth.com/jsyn/developers/download.php
from jsyn.
Question: what is the proper sequence for restarting the synth engine? Synth.stop, then Synth.start OR Synth.stop, Synth.terminate, Synth.initialize, Synth.start?
from jsyn.
You should be able to Synth.stop() then Synth.start(). If not then it is a bug.
from jsyn.
I think this is fixed now. If not then let me know and I will reopen it.
from jsyn.
Related Issues (20)
- Resolve version numbers between JSyn and build.gradle HOT 1
- Ant build Failing due to slf4j dependency HOT 1
- Sometimes WaveRecorder doesn't stop the StreamingThread when used with realTime = false HOT 5
- port TJ_Devices from old JSyn to new API for multi-channel demo
- move old Roadmap to GitHub Wiki
- Suggest better docs for setSustainBegin and End HOT 1
- Broken link in online usersguide docs
- Need DoubleTable( FloatSample ) constructor
- Glitch When Playing Through Bluetooth HOT 1
- Different amplitude value for a VariableRateDataReader HOT 1
- use ByteBuffer wrap() and order() for WAV and AIFF
- Publish JSyn on Maven HOT 9
- Fix contributor name on NOTICE.txt HOT 1
- Starting a Synthesizer with Port Audio and a device input count of greater then two crashes HOT 3
- Port TJ_Devices.java to new repo HOT 1
- LineIn not working on MacOS Big Sur
- ExponentialRamp crashes on negative input
- Selecting a module moves it slightly HOT 1
- Add capability to WaveRecorder, and maybe WaveFileWriter, to write to an OutputStream
- Tests failing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsyn.