Sine extends AbstractSource { public void setAmplitude(short A) { this.A = A; } Sine(PriorityQueueScheduler scheduler); AudioInput getAudioInput(); void setAmplitude(short A); short getAmplitude(); void setFrequency(int f); int getFrequency(); @Override Frame evolve(long timestamp);  }
@Test public void testSignal() throws Exception { sine.activate(); analyzer.activate(); audioMixer.start(); Thread.sleep(2000); sine.deactivate(); analyzer.deactivate(); audioMixer.stop(); Thread.sleep(1000); int[] spectra = analyzer.getSpectra(); assertEquals(1, spectra.length); assertEquals((double)50, (double)spectra[0], 5); sine.setAmplitude((short)0); sine.activate(); analyzer.activate(); audioMixer.start(); Thread.sleep(1000); sine.deactivate(); analyzer.deactivate(); audioMixer.stop(); spectra = analyzer.getSpectra(); assertEquals(0, spectra.length); }