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. can any body explain me how to execute the program
View Tutorial          By: nikhil at 2009-06-04 23:56:11

2. its giving exception
javax.comm.NoSuchPortE

View Tutorial          By: Dc at 2012-06-07 04:08:19

3. 'Numbers' is the name of his table, you need to su
View Tutorial          By: Amir at 2010-09-15 10:59:20

4. can this code communicate with other pc that using
View Tutorial          By: lolo at 2011-10-28 09:14:30

5. hi
View Tutorial          By: raj at 2010-02-12 02:48:09

6. You have mentioned that
to use this program

View Tutorial          By: Naasik at 2012-08-05 00:15:57

7. this site is good, can anyone plz suggest me how t
View Tutorial          By: Prithvi at 2008-08-27 01:09:56

8. Hi,

i need a program to send sms wh

View Tutorial          By: Sindhuja at 2013-05-29 07:07:15

9. How to return values when there may be muliple row
View Tutorial          By: asd at 2013-11-22 01:24:47

10. i am getting this error how to erase it please tel
View Tutorial          By: laxmibvsn at 2012-10-16 15:45:05