Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java mp3 player

import java.io.File;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;

String bip = "song.mp3";
Media hit = new Media(new File(bip).toURI().toString());
MediaPlayer mediaPlayer = new MediaPlayer(hit);
mediaPlayer.play();
Comment

mp3 player Java

public void playSound() {
    try {
        AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("D:/MusicPlayer/fml.mp3").getAbsoluteFile());
        Clip clip = AudioSystem.getClip();
        clip.open(audioInputStream);
        clip.start();
    } catch(Exception e) {
        System.out.println("Error with playing sound.");
        e.printStackTrace();
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: casting in java 
Java :: Java getClass() method 
Java :: how to set default color in android studio 
Java :: convert python code to java 
Java :: java sort array int 
Java :: types of classes in java 
Java :: java hello world program 
Java :: java, how to find the most repeated character 
Java :: imperative programming paradigm example 
Java :: java get class by string name 
Java :: input 3 int 1 line in java 
Java :: java random value threadlocalrandom 
Java :: print prime numbers in java 
Java :: matlab leslie eigenvalue java 
Sql :: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning. 
Sql :: uninstall mysql ubuntu 18.04 
Sql :: mysql status 
Sql :: redshift running queries 
Sql :: sql server current date without time 
Sql :: alter table column change data type to text mysql 
Sql :: mysql return 0 if null 
Sql :: list tables sqlite 
Sql :: to date oracle with time 
Sql :: postgresql add not null constraint 
Sql :: select users 
Sql :: rermove categories woocommerce sql 
Sql :: how to group by month using sql server 
Sql :: mysql import gz 
Sql :: su: Authentication failure mysql 
Sql :: oracle compile whole schema 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =