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

17
LINES

< > BotCompany Repo | #1009234 // playOgg - doesn't block, closes resources automatically

JavaX fragment (include)

1  
lib 1009238 lib 1009239 lib 1009240 // EasyOgg
2  
3  
import org.newdawn.easyogg.*;
4  
5  
static OggClip playOgg(File ogg) ctex {
6  
  ret playOgg(newFileInputStream(ogg));
7  
}
8  
9  
static OggClip playOgg(InputStream in) ctex {
10  
  final OggClip ogg = new OggClip(in);
11  
  ogg.play();
12  
  thread "Ogg Player" {
13  
    while (licensed() && !ogg.stopped()) sleep(1);
14  
    ogg.close();
15  
  }
16  
  ret ogg;
17  
}

Author comment

Began life as a copy of #1003614

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: #1009234
Snippet name: playOgg - doesn't block, closes resources automatically
Eternal ID of this version: #1009234/13
Text MD5: a57974800f5380b0fd8accf2ec5f66a7
Author: stefan
Category: javax / desktop
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-19 17:37:38
Source code size: 385 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 521 / 560
Version history: 12 change(s)
Referenced in: [show references]