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)

lib 1009238 lib 1009239 lib 1009240 // EasyOgg

import org.newdawn.easyogg.*;

static OggClip playOgg(File ogg) ctex {
  ret playOgg(newFileInputStream(ogg));
}

static OggClip playOgg(InputStream in) ctex {
  final OggClip ogg = new OggClip(in);
  ogg.play();
  thread "Ogg Player" {
    while (licensed() && !ogg.stopped()) sleep(1);
    ogg.close();
  }
  ret ogg;
}

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: 520 / 559
Version history: 12 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)