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. Nice guidelines which provide to understand struts
View Tutorial          By: harshal patel at 2010-08-13 04:59:16

2. You have stretch it more then enough even then the
View Tutorial          By: Chirag at 2012-12-04 16:15:13

3. very good and very simple for beginers
View Tutorial          By: Biju Thomas at 2010-08-17 08:09:30

4. can you please e mail me a code about hotel reserv
View Tutorial          By: princeton at 2008-09-19 02:32:13

5. hello,
how can i add a specific variable va

View Tutorial          By: Abdulla at 2014-12-05 15:30:27

6. Hi, I second that Raghav, kindly can u email me a
View Tutorial          By: SAM at 2011-03-06 05:03:09

7. thanks...........its really very helpful for me...
View Tutorial          By: ashwini agarmore at 2013-01-17 06:31:21

8. Hi for Java beginners this is the right place to s
View Tutorial          By: Anon at 2009-02-01 21:14:28

9. Only first row is exported, help to export all the
View Tutorial          By: Achyut at 2014-12-18 04:26:26

10. hi ashraf , ramlak and all,
i m new here .

View Tutorial          By: hemendra at 2009-12-28 21:59:34