×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    8

    problem in play sound MIDI and MP3 file

    I have problem for play *.midi and *.mp3 sound but work on *.wav

    my code iswork good)
    filename = 'c:\\bong.wav'
    s=audio.Sound.open(filename)
    s.play()


    but my code isnot work)
    filename = 'c:\\automatic.mp3'
    s=audio.Sound.open(filename)
    s.play()

    error is:
    SymbianError: [Errono -5] Error
    opening file: KErrNotSuppoarted

    some one help me please?
    Thank you very much

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: problem in play sound MIDI and MP3 file

    Hello cman and Welcome to the Forum

    This is a developers DiBo.As You are new to the DiBo, let me tell you that

    1)If your consits of a code then you should embed it within the CODE option that is available from the symbol # during posting.
    2) Please donot make multiple threads with the same topic (as you have done 2 threads with this topic)

    Now to your problem
    Code:
    import appuifw
    import e32
    import audio
    
    
    def playmidi():
        S = audio.Sound.open("E:\\sound1.mid")
        S.play()
        menu()
    def playmp3():
        S = audio.Sound.open("E:\\sound2.mp3")
        S.play()
        menu()
    
    playmidi() ##or playmp3() for mp3 file
    The above code works for both midi as well as mp3 files.

    Hope that helps

    Best Regards
    croozeus
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: problem in play sound MIDI and MP3 file

    Quote Originally Posted by croozeus View Post
    Hello cman and Welcome to the Forum

    This is a developers DiBo.As You are new to the DiBo, let me tell you that

    1)If your consits of a code then you should embed it within the CODE option that is available from the symbol # during posting.
    2) Please donot make multiple threads with the same topic (as you have done 2 threads with this topic)

    Now to your problem
    Code:
    import appuifw
    import e32
    import audio
    
    
    def playmidi():
        S = audio.Sound.open("E:\\sound1.mid")
        S.play()
        menu()
    def playmp3():
        S = audio.Sound.open("E:\\sound2.mp3")
        S.play()
        menu()
    
    playmidi() ##or playmp3() for mp3 file
    The above code works for both midi as well as mp3 files.

    Hope that helps

    Best Regards
    croozeus
    Hello Croozeus

    Do you hear something ?
    No I don't think so

    Try this instead of your not working code :

    Code:
    import appuifw
    import e32
    import audio
    
    
    def playmidi():
        global S
        S = audio.Sound.open("E:\\sound1.mid")
        S.play()
        menu()
    def playmp3():
        global S
        S = audio.Sound.open("E:\\sound2.mp3")
        S.play()
        menu()
    
    playmidi() ##or playmp3() for mp3 file
    Thanks to Jethro.fn for discovering this problem and bring us a solution !

    YES adding global S is VERY IMPORTANT !

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

Similar Threads

  1. CMdaAudioPlayerUtility can not play AMR file.
    By khurshed79 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-08-01, 09:39
  2. how to play mp3 files/FM on nokia 3660?
    By despair89 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2004-04-11, 22:08
  3. how to play mp3 files/FM on nokia 3660?
    By despair89 in forum General Development Questions
    Replies: 0
    Last Post: 2004-04-11, 14:30
  4. MIDI PREVIEW LIKE PHONE SOUND
    By kubajs in forum Digital Rights Management & Content Downloading
    Replies: 2
    Last Post: 1970-01-01, 02:00

Posting Permissions

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