Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 17:27, 24 October 2007.

Como tocar mp3 a partir de um servidor

From Forum Nokia Wiki

Original: How to play mp3 from server in Java ME

O método abaixo mostra como um arquivo mp3 pode ser execudado diretamente de um servidor utilizando o Java ME.

public void playAudio()
{
  try
  {
    String url = "http://server/audio.mp3";
    HttpConnection conn = (HttpConnection)Connector.open(url, 
      Connector.READ_WRITE);
    InputStream is = conn.openInputStream();
    player = Manager.createPlayer(is,"audio/amr");
 
    player.realize();
    // pega o controle de volume do player e o define para o maximo
    vc = (VolumeControl) player.getControl("VolumeControl");
    if(vc != null)
    {
      vc.setLevel(100);
    }
    player.prefetch();
    player.start();
  }
  catch(Exception e)
  {}
}
Related Discussions
Thread Thread Starter Forum Replies Last Post
mp3 player functions? neilruparel Mobile Java Media (Graphics & Sounds) 3 2007-05-09 12:31
Series 40 problem felixksp Mobile Java General 9 2007-07-01 15:03
MMMFControllerEventMonitorObserver not working ? Suyash Symbian Media (Graphics & Sounds) 5 2008-03-19 13:59
Download mp3 via php has problem digitalss General Browsing 1 2005-06-09 11:24
playing mp3 cosmio General Discussion 0 2004-11-27 06:58
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZjavaQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX