Exemplo n.º 1
0
  @Before
  public void setUp() {
    timer = new TimerImpl();
    timer.start();

    tester = new TransmissionTester2(timer);

    proxy = new Proxy("test");

    ArrayList<CodecFactory> codecFactories = new ArrayList();
    codecFactories.add(pcmaEncoderFactory);
    codecFactories.add(pcmaDecoderFactory);
    codecFactories.add(pcmuEncoderFactory);
    codecFactories.add(pcmuDecoderFactory);
    codecFactories.add(gsmEncoderFactory);
    codecFactories.add(gsmDecoderFactory);
    codecFactories.add(speexEncoderFactory);
    codecFactories.add(speexDecoderFactory);
    codecFactories.add(g729EncoderFactory);
    codecFactories.add(g729DecoderFactory);

    dspFactory.setName("test");
    dspFactory.setCodecFactories(codecFactories);

    dsp1 = (Processor) dspFactory.newInstance(null);
    dsp2 = (Processor) dspFactory.newInstance(null);

    tester.connect(dsp1.getInput());
    dsp1.getOutput().connect(proxy.getInput());
    dsp2.getInput().connect(proxy.getOutput());
    tester.connect(dsp2.getOutput());

    dsp1.getInput().addListener(tester);
    dsp1.getOutput().addListener(tester);

    dsp2.getInput().addListener(tester);
    dsp2.getOutput().addListener(tester);

    proxy.getInput().addListener(tester);
    proxy.getOutput().addListener(tester);
  }
Exemplo n.º 2
0
  @Before
  public void setUp() {
    timer = new TimerImpl();
    timer.start();
    short A = Short.MAX_VALUE / 2;

    int[] F = new int[] {100, 200};
    int[] T = new int[] {1, 1};

    gen = new PhoneSignalGenerator("phone.gen", timer);
    gen.setAmplitude((short) 320);
    gen.setFrequency(F);
    gen.setPeriods(T);

    det = new PhoneSignalDetector("phone.detector");
    det.setFrequency(F);
    det.setPeriods(T);
    det.setVolume(-30);
    det.setEventID(50);
    det.addListener(this);
    gen.connect(det);
  }
Exemplo n.º 3
0
 @After
 public void tearDown() {
   timer.stop();
 }
 @Before
 public void setUp() {
   timer = new TimerImpl();
   timer.start();
   tester = new TransmissionTester(timer);
 }