You Are Here:

Community: Developer Discussion Boards

#1 Old mmapi prefetch problem - 2007-04-11, 09:02

Join Date: Feb 2007
Posts: 7
ouendan
Offline
Registered User
Hi, I'm trying to play an audo file with j2me and mmapi, but it crashes and I don't know why. This is my code:

Code:
try {
           
            servidor.append("Archivo cargado\n");
            m_player = Manager.createPlayer(is, "audio/mp3");          
                        
            m_player.realize();
            
            // get volume control for player and set volume to max
            vc = (VolumeControl) m_player.getControl("VolumeControl");
            if(vc != null) {
                vc.setLevel(100);
                               
            }
            
                        
        } catch(Exception e) {
            e.printStackTrace();
            servidor.append("error");
        }
        
        try {
            m_player.prefetch();
        } catch (MediaException ex) {
            ex.printStackTrace();
            servidor.append(ex.getMessage());
        }
                
        
        try {
            servidor.append("estado actual:"+m_player.getState()+"\n");
            m_player.start();
        } catch (MediaException ex) {
            ex.printStackTrace();
            servidor.append(ex.getMessage());
           
        }
I've tried with midi and mp3 files, but doesn't work, it crashes in m_player.prefetch(), and I get the next error:

"prefetch error: -5"

but I can't find what kind of error is, and how to fix it.

The file is in the sd file, but I've tried with files in local memory too.

Thanks for your help

Edit: my phone is a nokia n73
Reply With Quote

#2 Old Re: mmapi prefetch problem - 2007-04-11, 20:19

Join Date: Feb 2007
Posts: 5
Vitucho5005
Offline
Registered User
hi ouendan. I have had that problem, i think...i don't renember. But check the size of the file, maybe it is to big to be loaded in memory (task that the player do)...or you can try to audio/mpeg instaed of audio/mp3...
i hope that's work.

Bueno eso es todo, solamente veo que vos tambien sos de latino america, así que no puedo evitar pegarte un saludo!!. (La respuesta fue en ingles para que a todos sirva, bah si sirve para algo..jejej) Nos vemos!.

Cya!!
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
MMAPI and jsr75 in one midlet = fatal problem dusanbaranec Mobile Java General 8 2006-06-07 08:18
Midi file playing problem haristeguh Mobile Java Media (Graphics & Sounds) 0 2006-04-06 02:02
MMAPI Problem chriditz Mobile Java General 1 2004-08-02 06:58
mmapi 3660 memory problem Leicester22 Mobile Java Media (Graphics & Sounds) 0 2004-07-30 18:01
S90 MIDP SDK 1.0 Beta MMAPI Problem kfalck Mobile Java Tools & SDKs 0 2004-06-21 20:44

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia