Code example for SourceDataLine

Methods: startopen

0
      this.aesCipher = Cipher.getInstance("AES/CBC/NOPADDING");
      receiveSocket = new DatagramSocket(port);
 
      DataLine.Info info = new DataLine.Info(SourceDataLine.class, new AudioFormat(session.getFormat().getSampleRate(), session.getFormat().getSampleSize(), 2, true, true));
      line = (SourceDataLine) AudioSystem.getLine(info);
      line.open();
      line.start();
    } catch (Exception e) {
      throw new RuntimeException(e);
    } 
    secretKey = new SecretKeySpec(session.getAesKey(), "AES");
    secretKey = new SecretKeySpec(session.getAesKey(), "AES");
    keySpec = new IvParameterSpec(session.getAesIv());
 
    int frameSize = session.getFormat().getFrameSize();
    alac = AlacDecodeUtils.create_alac(session.getFormat().getSampleSize(), 2);
    alac.setSetinfo_max_samples_per_frame(frameSize);
    alac.setSetinfo_rice_historymult(session.getFormat().getRiceHistoryMult());
    alac.setSetinfo_rice_initialhistory(session.getFormat().getRiceInitialHistory());
    alac.setSetinfo_rice_kmodifier(session.getFormat().getRiceKModifier());