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

15
LINES

< > BotCompany Repo | #1009640 // javaSound_playAudioInputStream

JavaX fragment (include)

1  
import javax.sound.sampled.*;
2  
import javax.sound.sampled.Clip;
3  
import javax.sound.sampled.Line;
4  
5  
static void javaSound_playAudioInputStream(AudioInputStream ais) ctex {
6  
  Line.Info linfo = new Line.Info(Clip.class);
7  
  Line line = AudioSystem.getLine(linfo);
8  
  Clip clip = (Clip) line;
9  
  //clip.addLineListener(...);
10  
  clip.open(ais);
11  
  clip.setFramePosition(0); // troubleshooting?
12  
  clip.start();
13  
  javaSound_closeClipOnStop(clip);
14  
  print("javaSound playing");
15  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009640
Snippet name: javaSound_playAudioInputStream
Eternal ID of this version: #1009640/7
Text MD5: a18c7804dec9e049e974f744de0d92bd
Author: stefan
Category: javax / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-12 21:29:43
Source code size: 478 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 499 / 529
Version history: 6 change(s)
Referenced in: [show references]