| Reply | « Previous Thread | Next Thread » |
|
Hi, I tried porting my game to N70 phone, but encountered a major problem with sound playing on it.
I tried using the code i'm using successfully on 6630, but N70 seems to have some bugs which prevent the sound from playing. After some testing i did the following observations: 1. After call to Sount.start(), it will not play untill i try to access some resource (i.e. load some image). In this state the phone will play no other sound. 2. In the same state (sound started but not played) the phone will IGNORE incoming call interrupts - it will start ringing when i try to load some resource. 3. (This happens without trying to play a sound) In-game i slided the camera cover by accident. There was no reaction from the phone.... again untill i tried to load some resource, at which point the camera App started and sent my game into background... Have anyone encountered similar problem? I tried loading a small (8 bytes) resource immidiately after starting the sound, but it didnt help... |
|
Do'h !
Just found a solution myself... Dont ever forget to put in some sleep to your thread (30ms is enough here). All problems vanished right away |
|
Before or after Sound.start() ?
|
|
generally in your thread, just one sleep in your main game loop - not at every sound call
|
|
yep ... the sleep(30) really works.
Thanx. i only found this bug on fw [v2.0536.0.2]. fw like [v2.0537.1.7] or [v2.0539.1.2] or [v2.0546.2.3] did not manifest it. Maybe Nokia people fixed the VM inbetween. Thanx again. |
| GringoCroco |
| View Public Profile |
| Find all posts by GringoCroco |
|
oh, i found that on a project setting the volume in a loop with variable volume levels [from 45 to 75] also fixed the "i won't play your sound" issue.
|
| GringoCroco |
| View Public Profile |
| Find all posts by GringoCroco |
|
bro i have problem with audio player can u help me pls?
|
|
I'm still having this problem, but only occasionally, it seemed for me to be more depedant on memory. If after I run my application then go back to the os via the symbian key then go back to the application the problem with call interrupts never occurs.
|
|
try writting some bytes to a temp RMS from time to time.
don't ask how and why this may be a solution ... it's J2ME-on-Nokia, it's not supposed to make any sense. -on which firmware are you seeing this problem? |
| GringoCroco |
| View Public Profile |
| Find all posts by GringoCroco |
|
"it's J2ME-on-Nokia, it's not supposed to make any sense" yes I second that opinion.
I'm seeing this on 2.0539.1.2 and 2.0537.1.7 Problem with putting extra sleeps in, is that I don't want my app to run any slower. |
|
can i play file not in jar packeg? i have this problem i record audio and save in file:///C:/Nokia/Sounds/audio.mp3 (recorder ok) but when i play this file run this exception "Symbian OS error: -5".
some code Code:
else if (c == playCommand)
{
tb.setLabel(filePath);
System.getProperty("java.ext.dir");
//InputStream source = getClass().getResourceAsStream(filePath);
new PlayerThread("file:///C:/Nokia/Sounds/audio.amr",tb).start();
tb.setString("Playing ");
}
___________________________________
public PlayerThread(InputStream is, String type, TextField tb) {
this.is = is;
this.type=type;
this.tb = tb;
}
public PlayerThread( String filename, TextField tb) {
this.fileName=filename;
this.tb = tb;
}
public void run()
{
try{
System.getProperty("java.ext.dir");
if(fileName==null)
player = Manager.createPlayer(is, type );
else
player = Manager.createPlayer(fileName);
player.addPlayerListener(this);
player.start();
tb.setString(player.getDuration()+"");
}catch(Exception e){tb.setString(e.getMessage());}
}
|
|
Hi,
This error is: KErrNotSupported -5 The operation requested is not supported In order to use this file URL you should use a FileConnection instead. Does your device support it? BR, Juarez Jr |
|
yes my device support it, infact i can explore filesystem. Help me pls, i can play audio file in .jar but i can't play file in filesystem.
|
|
Hi,
I cannot confirme by checking your code if you're using the javax.microedition.io.file.FileConnection interface. It seems you're not. You should check what's needed to work with the FileConnection Opt Pack from JSR-75. So see this doc for more: Introduction To The FileConnection API (With Example) v1.1 http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html Make sure you understand what a FileConnection is and how to use it. I hope it helps! BR, Juarez Jr |
|
Quote:
PS i can play *.mp3 in file .jar. Help me pls |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Theme Studio 3 and n90 / n70 Problems | Ezz666 | Streaming and Video | 0 | 2006-02-04 14:18 |
| MIDI Sound problem (J2ME / Series 60) | JPapke | Mobile Java Media (Graphics & Sounds) | 2 | 2004-10-29 09:17 |
| problems with sound volume | the_professor11 | Mobile Java Media (Graphics & Sounds) | 0 | 2004-03-09 20:16 |
| Sound problems on 6600 | disco2002 | General Symbian C++ | 2 | 2004-02-03 16:49 |
| Nokia 6600 sound problems | disco2002 | Mobile Java General | 4 | 2003-12-16 14:17 |