Comment on Tutorial - Play a multimedia file in J2ME Program (Audio/Video) using MMAPI By Vikram Goyal



Comment Added by : Rowan

Comment Added at : 2014-07-17 10:26:02

Comment on Tutorial : Play a multimedia file in J2ME Program (Audio/Video) using MMAPI By Vikram Goyal
public void playSound(String filename) {
//stop current playing sound
try {
if (player != null) {
player.stop();
player.close();
player.deallocate();
player = null;
}
} catch (Exception ex) {
ex.printStackTrace();
}

//play new sound
try {
inStream = getClass().getResourceAsStream(filename);
player = Manager.createPlayer(inStream, "audio/x-wav");
player.realize();
player.prefetch();
//player.setMediaTime(-1);
//player.setTimeBase(null);
player.start();
} catch (Exception ex) {
ex.printStackTrace();
}
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. It takes me time to understand the process of the
View Tutorial          By: Abdullah Ibrahim at 2012-04-11 00:38:23

2. Nice tutorial, I got how it's done, but the differ
View Tutorial          By: FriendlyNoob at 2015-07-20 17:27:08

3. Very good explanation . I was very confuse but rea
View Tutorial          By: Shahabaj at 2010-08-10 08:58:39

4. It's a good eg to learn join and isAlive method.Bu
View Tutorial          By: Nithin at 2012-02-02 08:43:28

5. I have downloaded all the files
SMSClient.j

View Tutorial          By: Sanjay at 2010-06-29 04:48:16

6. how to read any xml file or i want to a universal
View Tutorial          By: shankar lal at 2014-09-29 12:40:20

7. I have modified this example a bit and I'm using a
View Tutorial          By: Lee Murray at 2010-11-02 03:41:56

8. Good example thank you so much
View Tutorial          By: Albadri at 2011-05-14 15:48:17

9. nice explanation
View Tutorial          By: harish at 2012-12-04 06:20:45

10. can anybody hp me how to create a rms database in
View Tutorial          By: contractornimesh at 2011-01-04 00:12:08