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

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. Hello,

Can you please send me the c

View Tutorial          By: criz at 2007-10-16 21:06:30

2. good
View Tutorial          By: gummalla subbarao at 2011-03-09 01:24:58

3. It doesnt works in Mozilla Firefox.


View Tutorial          By: K Vijay Anand at 2010-06-20 09:11:26

4. this is a site site for our problem to be sorted o
View Tutorial          By: Atique at 2009-11-02 00:15:18

5. What is the difference between an Interface and an
View Tutorial          By: RAJA at 2015-06-26 17:28:31

6. Thank you for this useful script!
View Tutorial          By: opencart module at 2011-01-03 21:21:37

7. what about memory in case of struts 2 at a time nu
View Tutorial          By: lakku at 2010-08-13 06:24:02

8. Small modification.
System.out.println(&qu

View Tutorial          By: Rohit at 2012-02-07 16:22:52

9. hi RAMLAK i am akankshain and getting these erro
View Tutorial          By: akanksha at 2011-12-06 10:15:47

10. really understandable
but 'm expecting with

View Tutorial          By: rajkumar at 2008-03-14 03:53:21