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. i don,t think so that it is sufficient to understa
View Tutorial          By: amit singh at 2009-05-27 06:54:20

2. Impressing answer guys...
View Tutorial          By: Jayeeta Pal at 2011-06-28 03:18:26

3. This is very helpfull to us.........thnq
View Tutorial          By: lavanya at 2012-03-17 05:43:12

4. Your post helped me to resolve the SSH exception..
View Tutorial          By: Ashwini at 2008-07-14 12:47:32

5. I have my application running on server that is th
View Tutorial          By: vitamin b12 at 2009-12-04 10:51:56

6. nicely explained :)
View Tutorial          By: ibtisam at 2012-04-26 10:31:58

7. this is the best example of method overriding but
View Tutorial          By: Dipesh at 2009-09-09 12:52:21

8. Looks good, but don't use gets(). gets() is respon
View Tutorial          By: Luke at 2011-11-21 09:03:38

9. It is clear but at the starting code there is a wr
View Tutorial          By: Kiranmoy Pradhan at 2015-08-20 21:55:15

10. i dont understand
View Tutorial          By: amabelle pascual at 2014-01-09 23:47:14