| Reply | « Previous Thread | Next Thread » |
|
I'm developing a Midlet that should play a wave-file from a custom inputstream from a socket connection. The funny is that is working perfect in the emulator but in the real device (a N73) the programs halts on the p.realize() line. Does anyone know what is wrong?
---- code ----- sc = (SocketConnection)Connector.open("socket://" + server + ":" + port); is = sc.openInputStream(); ... dis = new MediaInputStream(is); ... p = Manager.createPlayer(dis, "audio/x-wav"); p.addPlayerListener(this); p.realize(); // <--- stop here p.prefetch(); p.start(); |
| borje.granberg |
| View Public Profile |
| Find all posts by borje.granberg |
|
What is the port number you are connecting to? Unsigned midlets are not allowed to create a socket connections to ports 80, 8080 and 443 (although a security exception error message should be shown...)
Hartti |
|
I'm connecting på port 7554
|
| borje.granberg |
| View Public Profile |
| Find all posts by borje.granberg |
|
Hi,
have u tried out with a sample code which plays a file in N73. Thanks Soku |
|
Yes I can play i file on the phone. I have also tried in an other application to play a file trough a custom inputstream. In the read() method I have added a sleep to simulate a slow network connection. On the emulator the file plays during load. This I can hear because the sound is stopping regularly. On the phone it seams like it waits til it has all the file in memory. It takes longer before the sound starts to play and when it does there are no silent breaks.
The reason for this is that the phone doesn't support progressive playback. But WHY does the phone play the (delayed) local file and not the network transported wav-file? The API says that read returns -1 when the end of the stream is reached. This doesn't happen. Why? |
| borje.granberg |
| View Public Profile |
| Find all posts by borje.granberg |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Create 3GP player with J2ME for Mobile | dexxa05 | Mobile Java Media (Graphics & Sounds) | 53 | 2008-03-27 20:52 |
| fullscreen ignored in n73 j2me player | PeppeM2 | Mobile Java Media (Graphics & Sounds) | 1 | 2007-07-03 15:42 |