Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1009287 // Echo! [shortened]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (345L/3K/10K).

!7

// Original source: AudioLoop from jsresources.org

static int DEFAULT_INTERNAL_BUFSIZ = 40960, DEFAULT_EXTERNAL_BUFSIZ = 40960;
static S mixerName;

p {
  new AudioLoop(javaSound_cdQuality°, DEFAULT_INTERNAL_BUFSIZ, DEFAULT_EXTERNAL_BUFSIZ, mixerName).start°;
}

sclass AudioLoop extends Thread {
  TargetDataLine in;
  SourceDataLine out;
  new Flag stopFlag;
  int externalBufferSize;
  
  *(AudioFormat format, int internalBufferSize, int *externalBufferSize, S mixerName) {
    Pair<TargetDataLine, SourceDataLine> p = javaSound_bothLines(mixerName, format, internalBufferSize);
    in = p.a; out = p.b;
  }
  
  public void start { in.start°; out.start°; super.start°; }
  void stopRecording { in.stop°; out.close°; stopFlag.raise°; } // "stop()" was taken

  public void run° { javaSound_streamFromLineToLine(in, out, externalBufferSize, stopFlag); }
}

Author comment

Began life as a copy of #1009283

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009287
Snippet name: Echo! [shortened]
Eternal ID of this version: #1009287/24
Text MD5: 2a5747b94e30caa0a3af8b053c3d0d9e
Transpilation MD5: 96bf78e912b34f4db97dc59278b6532b
Author: stefan
Category: javax / sound
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-21 05:42:24
Source code size: 898 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 441 / 574
Version history: 23 change(s)
Referenced in: #1016678 - Sine Signal Test [OK]