viernes, 8 de abril de 2011

BlackBerry: Streaming Audio

WoW! I've been many days trying to stream audio on my BlackBerry app, using the BufferedPlayBackDemo from the BlackBerry JDE examples with no success. I was so annoyed because it worked on my emulator, but never on my devices, so i decided to keep on researching and i finally used another code.

The code i'm actually using for my streaming is very much lite and easier than the BlackBerry's example, you only have to use this function, and voila! your app will stream audio from the internet!


public void Player(String url){
    Player p;
    
    try {
p = Manager.createPlayer(url);
p.start();
} catch (IOException e) {
e.printStackTrace();
System.out.println("I/O Exception: "+e);
    } catch (MediaException e) {
e.printStackTrace();
System.out.println("Media Exception: "+e);
    }
}


You can download my entire project example from this link STREAMING AUDIO EXAMPLE

1 comentario: