Hi all, I'm having problems right now trying to play my sound.. This is the code..
When I used a internet url for streaming the wav file as an argument in getResourceAsStream(); it worked fine, but when i try to use the local wav file it gave me an error (IllegalArgumentException). I don't know if the path is fine, according to "/relax.wav" the file should be located in the 'res' folder which is added as a Resource Path in the MIDlet's configuration? If not, where should I put the file?Code:try { InputStream in = getClass().getResourceAsStream("/relax.wav"); Player player = Manager.createPlayer(in, "audio/x-wav"); player.start(); } catch (Exception e) { showException(e); return; }
Thanks in Advance,
Regards,
Armando León

Reply With Quote

