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. HELP ME HOW TO ANALZE THE PROGRAM??????????
View Tutorial          By: MICHELLE FLORES at 2009-01-21 23:24:52

2. How to do the following
Create a class With

View Tutorial          By: Anurag at 2014-01-03 10:14:45

3. its a nice site bcoz it gives a bright IDEA about
View Tutorial          By: surya santhan at 2012-07-11 16:28:06

4. Hello every one. I am working on my project in j2m
View Tutorial          By: Pradeep Reddy at 2011-01-04 05:15:51

5. I want a code to receive message from GSM modem us
View Tutorial          By: Mayur at 2011-04-05 00:00:05

6. does this code work with netbeans. if not can anyo
View Tutorial          By: Alton at 2010-04-02 22:36:57

7. thanx allot its a very good sample , but im trying
View Tutorial          By: Waleed Qaffaf at 2011-06-09 09:37:15

8. Program is good and easy to understand
View Tutorial          By: sravs at 2011-05-16 00:45:05

9. /*for (i=0; i<lim-1 && (c=getchar())!=E
View Tutorial          By: GD at 2012-07-14 12:47:27

10. U should give the output also.. then only it will
View Tutorial          By: Mohamed Younus at 2011-07-07 10:13:54