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. how do i get the java tutorial material...
View Tutorial          By: Muruga at 2012-10-29 21:10:17

2. what's the deffrint between "String[] [] Arra
View Tutorial          By: ahmad at 2009-08-24 03:01:11

3. can anyone please provide me how to map the column
View Tutorial          By: Gaurav Balyan at 2012-01-03 11:09:26

4. someone explain how to use PreparedStatements with
View Tutorial          By: Manikprabhu at 2011-03-26 00:04:54

5. its good and well performance
View Tutorial          By: siva.c at 2014-09-02 08:18:19

6. I did not get the same result for memcpy - e and f
View Tutorial          By: dml at 2012-01-02 13:32:20

7. Well done. I am a mobile application developer. I'
View Tutorial          By: Wendi-tan at 2008-09-03 18:45:41

8. yaar this example is easy to understand but other
View Tutorial          By: richa at 2009-09-08 13:52:37

9. nice effort
View Tutorial          By: Tiger at 2011-07-06 02:17:13

10. Thanks Steven, That is an exhaustive list of diffe
View Tutorial          By: Robert at 2008-12-08 22:17:47