×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    110

    Error "MMFaudioClient 4"

    I'm create play file *.mp3:

    #ifndef AUDIO_H_
    #define AUDIO_H_
    #include <MdaAudioSamplePlayer.h>

    // CLASS DECLARATION

    class CAudio : public CBase, public MMdaAudioPlayerCallback
    {
    public: // Constructors and destructor
    static CAudio* NewL(const TDesC& aFileName);
    static CAudio* NewLC(const TDesC& aFileName);
    ~CAudio();

    public: // New methods

    void Play();
    void Stop();
    void SetVolume(TInt aVolume);
    private:
    CAudio();
    void ConstructL(const TDesC& aFileName);

    private:// From MMidiClientUtilityObserver
    void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
    void MapcPlayComplete(TInt aError);

    private: // Member variables
    CMdaAudioPlayerUtility* iPlayUtility;
    };

    #endif /* AUDIO_H_ */

    #include <eikenv.h>
    #include "Audio.h"


    CAudio::CAudio()
    {
    }

    CAudio::~CAudio()
    {
    if(iPlayUtility)
    {
    iPlayUtility->Stop();
    // iPlayUtility->Close();
    }
    delete iPlayUtility;
    }

    CAudio* CAudio::NewLC(const TDesC& aFileName)
    {
    CAudio* self = new (ELeave) CAudio();
    CleanupStack::PushL(self);
    self->ConstructL(aFileName);
    return self;
    }

    CAudio* CAudio::NewL(const TDesC& aFileName)
    {
    CAudio* self = CAudio::NewLC(aFileName);
    CleanupStack::Pop(self);
    return self;
    }

    void CAudio::ConstructL(const TDesC& aFileName)
    {
    iPlayUtility = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName, *this);
    }

    void CAudio::Play()
    {
    iPlayUtility->Play();
    }

    void CAudio::Stop()
    {
    iPlayUtility->Stop();
    }

    void CAudio::MapcPlayComplete(TInt /*aError*/)
    {
    iPlayUtility->Play();
    }

    void CAudio::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
    {
    if(aError == KErrNone)
    {
    //iPlayUtility->SetVolume(iPlayUtility->MaxVolume()/8);
    }
    }

    void CAudio::SetVolume(TInt aVolume)
    {
    if (aVolume == 1)
    {
    iPlayUtility->SetVolume(iPlayUtility->MaxVolume());
    }
    else
    {
    iPlayUtility->SetVolume(aVolume);
    }
    }
    in My class, i call class CAudio.

    iaudio = CAudio::NewL("C:\\1.mp3");
    iaudio->SetVolume(1);
    iaudio->Play();
    I'm debug. When it implement line "iaudio->SetVolume(1);", app Error "MMFaudioClient 4".
    Can anyone help me!

  2. #2
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: Error "MMFaudioClient 4"

    hello,
    i'm not on my pc, but have you already found this?
    http://www.developer.nokia.com/Commu...lient-4-panic-!
    regards
    pg

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    110

    Re: Error "MMFaudioClient 4"

    Thanks!
    But I could not fix error.

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,089

    Re: Error "MMFaudioClient 4"

    you can also refer here: http://blog.csdn.net/linzhiji/article/details/5288682

    Convert the page to English & search for MMFAudioClient 4.

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: Error "MMFaudioClient 4"

    Basically you would need to understand that you can not play until the file is successfully opened, same could go with the setting volume. So do change your logic to start playing only after the MapcInitComplete is called without an error.

Similar Threads

  1. Replies: 2
    Last Post: 2012-10-10, 10:23
  2. MMFAudioClient panic "2"
    By moldovan_catalin in forum Symbian Media (Closed)
    Replies: 8
    Last Post: 2011-03-25, 23:50
  3. WML - Error "Operation failed" / "your application is too large"
    By crajesh_2985 in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2009-10-06, 12:31
  4. Replies: 4
    Last Post: 2008-05-20, 19:07
  5. extern "C" gives "Illegal Empty Declaration error"
    By GreatWarrior in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2007-01-08, 16:55

Posting Permissions

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