Introduction

Play Audio File :

Nokia SDK provides the audio playing capability by using MMAPI(Mobile Media API).MMAPI provides a high level interface to provide specific HTTP, Audio & Video. MMAPI are compatible with both CLDC & CDC.

Source Code

Source Code : Comments :
AudioMidlet1.java
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.media.Manager;
import javax.microedition.media.Player;

public class AudioMidlet1 extends MIDlet {
Form myForm;
public AudioMidlet1() {
myForm=new Form("Playing Audio")
; // TODO Auto-generated constructor stub
}

protected void destroyApp(boolean unconditional){
// TODO Auto-generated method stub

}

protected void pauseApp() {
// TODO Auto-generated method stub

}

protected void startApp() {
try{

Player player=Manager.createPlayer(getClass().getResourceAsStream("/Audio/Friends.wav"), "audio/x-wav");
player.setLoopCount(2);
player.start();

Display.getDisplay(this).setCurrent(myForm);

//you need to install quick time player

}
(Exception e)
{
e.printStackTrace();
}

// TODO Auto-generated method stub

}
// TODO Auto-generated method stub

}



Import Display and Form class from package LCDUI

Snapshots


Download

Right Click Here And Select Save Target For Download :

Audio Playing- Powerpoint Presentation