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

21
LINES

< > BotCompany Repo | #1018467 // javaFXPlayAudio

JavaX fragment (include)

import javafx.scene.media.*;

static MediaPlayer javaFXPlayAudio_player;
static Lock javaFXPlayAudio_lock = lock();

svoid javaFXPlayAudio(File f) {
  initJavaFX();
  lock javaFXPlayAudio_lock;
  if (javaFXPlayAudio_player != null)
    javaFXPlayAudio_player.stop();
  else
    javaFXPlayAudio_player = new MediaPlayer(new Media(fileToURI(f)));
  javaFXPlayAudio_player.play();
}

svoid cleanMeUp_javaFXPlayAudio {
  if (javaFXPlayAudio_player != null) {
    javaFXPlayAudio_player.stop();
    javaFXPlayAudio_player = null;
  }
}

Author comment

Began life as a copy of #1018465

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018467
Snippet name: javaFXPlayAudio
Eternal ID of this version: #1018467/4
Text MD5: 82ea228c1b0bf9801993b0b8f354d9e1
Author: stefan
Category: javax / javafx
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-01 00:17:06
Source code size: 550 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 320 / 376
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)