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



Related Tutorials

Java program to get location meta data from an image

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

Archived Comments

1. Hi Ashley, thank you for this Android Gridview tut
View Tutorial          By: Giancarlo Leonio at 2013-03-12 00:37:15

2. Nothing that hasn't been said before, but I wasn't
View Tutorial          By: Calvin at 2010-03-22 20:43:10

3. thanks for all samples..
View Tutorial          By: 珠洲市 at 2013-03-01 09:47:46

4. i understand but i want many information and prog
View Tutorial          By: malathi at 2013-03-29 23:52:28

5. It gives strange result when we use == as delimite
View Tutorial          By: Amit at 2010-05-07 05:03:41

6. I want an example...to get multiple values using S
View Tutorial          By: Madhu at 2015-07-13 19:57:14

7. Hi Steve,

thanks for your code. It

View Tutorial          By: Johnny at 2010-10-29 09:25:41

8. right to point.. thanks man
View Tutorial          By: manish at 2012-07-28 15:01:26

9. int m,m2,n,n2;
for( m=0 , m2=0 ; m<

View Tutorial          By: muhammad abdullah at 2012-10-11 05:27:02

10. Sometimes java do support operator overloading as
View Tutorial          By: Gunjan Srivastava at 2011-07-06 09:14:00