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

17
LINES

< > BotCompany Repo | #1001267 // playMp3 (desktop)

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (5587L) is out of date.

1  
swappable svoid playMp3(File mp3, O... _) ctex {
2  
  if (!isJavaSoundOnly() && isLinux() && onPATH("play")) {
3  
    //print("Playing MP3 (`play`)...");
4  
    Number gain = cast optPar gain(_);
5  
    S output = backtick(print("> ", "play --magic " + (gain == null ? "" : "-v " + toDouble(gain) + " ")
6  
      + bashQuote(mp3)));
7  
    if (cic(output, "no handler for file extension"))
8  
      print(output);
9  
    else
10  
      ret;
11  
  }
12  
  playMp3_javaSound_basicPlayer(mp3, _);
13  
}
14  
15  
svoid playMp3(S snippetID) {
16  
  playMp3(loadLibrary(snippetID));
17  
}

Author comment

Began life as a copy of #1001095

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001267
Snippet name: playMp3 (desktop)
Eternal ID of this version: #1001267/17
Text MD5: 99d9b4a46a3f1bfbc8accdfff0779e89
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-21 20:51:28
Source code size: 542 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 678 / 976
Version history: 16 change(s)
Referenced in: [show references]