Play Sound in midlet


<strong>javax.microedition.media package is introduced in MIDP2.0 profile. This package supports sound and upward compatibility with MultiMedia API.It has Manager, Player and Control as main objects.Different audio files, from various locations can be played on mobile.</strong>

<strong>Simple Media Playback</strong>
<strong> try</strong>
<strong> { </strong>
<strong> Player p = Manager.createPlayer(”http://webserver/music.wav”);</strong>
<strong> p.start(); </strong>
<strong> } </strong>
<strong> catch (IOException ioe) { } </strong>
<strong> catch (MediaException me) { }</strong>

<strong>Playing Back from Media Stored in JAR</strong>
<strong> try </strong>
<strong> { </strong>
<strong> InputStream is = getClass().getResourceAsStream(”music.wav”); </strong>
<strong> Player p = Manager.createPlayer(is, “audio/X-wav”); </strong>
<strong> p.start(); </strong>
<strong> }</strong>
<strong> catch (IOException ioe) { } </strong>
<strong> catch (MediaException me) { }</strong>

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Zoemalang's community

ujung malang adalah Sebuah desa yang hilang terganti dengan ujung harapan

YoYo Games Blog Feed

Ujung malang adalah Sebuah desa yang hilang terganti dengan ujung harapan

Dealer Termurah

Menjual Segala Jenis Motor Baru Di Indonesia Cash Maupun Kredit

%d blogger menyukai ini: