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. unzip jquery-ui-1.10.3.custom

and c

View Tutorial          By: ajmal at 2013-06-06 10:44:55

2. This example really works and help a lot me to dis
View Tutorial          By: Monu Kumar at 2010-03-30 09:26:23

3. your code error

because i try to ru

View Tutorial          By: Nasser at 2013-01-09 10:33:34

4. thank you so much i learn from your tutorial i wis
View Tutorial          By: Anonymous at 2009-01-03 20:08:41

5. Thanks for the introduction of j2me
View Tutorial          By: AKbar Ali at 2009-10-19 03:56:58

6. very cool you said it! many thanks it's really coo
View Tutorial          By: ArAsh at 2008-12-11 06:41:13

7. its working... thanks.. thank you very much...!!!!
View Tutorial          By: Viswanathan at 2008-08-18 06:54:09

8. To DD -

The comment you just posted

View Tutorial          By: Alex at 2011-09-30 10:36:11

9. it was nice and helpful for me.
View Tutorial          By: mayank at 2015-03-01 08:35:48

10. any one can send serial port communication using n
View Tutorial          By: prakash at 2013-07-01 15:44:48