×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    210

    Cool EXE Audi playing problem

    i have made code using MMdaAudioPlayerCallback, it plays well in APP but in exe it gives troublle
    assuming prob with AO i tried and it workes but still having prob like never my
    MapcPlayComplete(..) getting called. may i was wrong in way i used AO for this.

    any working example

  2. #2
    Registered User
    Join Date
    Aug 2004
    Location
    Hyderabad,India
    Posts
    808

    Re: EXE Audi playing problem

    Paste some piece of code it will be easy to findout where it is going wrong

    BR,
    SSS

  3. #3
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    210

    Re: EXE Audi playing problem

    / SoundPlayer.cpp: implementation of the CSoundPlayer class.
    //
    //////////////////////////////////////////////////////////////////////

    #include "SoundPlayer.h"

    //////////////////////////////////////////////////////////////////////
    // Construction/Destruction
    //////////////////////////////////////////////////////////////////////

    CSoundPlayer::CSoundPlayer()
    {

    }

    CSoundPlayer::~CSoundPlayer()
    {
    delete iMdaPlayer;
    iMdaPlayer = NULL;
    }
    CSoundPlayer* CSoundPlayer::NewL(const TDesC& aFile)
    {
    CSoundPlayer* self = NewLC(aFile);
    CleanupStack::Pop(self);
    return self;
    }
    CSoundPlayer* CSoundPlayer::NewLC(const TDesC& aFile)
    {
    CSoundPlayer* self = new (ELeave) CSoundPlayer();
    CleanupStack::PushL(self);
    self->ConstructL(aFile);
    return self;
    }
    void CSoundPlayer::ConstructL(const TDesC& aFile)
    {
    // Create a file audio player utility instance
    iMdaPlayer=CMdaAudioPlayerUtility::NewFilePlayerL(aFile,*this);
    }
    void CSoundPlayer::Play()
    {
    if(iState==EReady)
    {
    iState=EPlaying;
    iMdaPlayer->Play();
    }
    }
    void CSoundPlayer::Stop()
    {
    if(iState==EPlaying)
    {
    iMdaPlayer->Stop();
    iState = EReady;
    }
    }
    // from MMdaAudioPlayerCallback
    void CSoundPlayer::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
    {
    iState = aError ? ENotReady : EReady;
    }
    void CSoundPlayer::MapcPlayComplete(TInt aError)
    {
    iState = aError ? ENotReady : EReady;
    this->Stop();
    }

    This will work in APP if i have some code such that there is time for framework to finish initialization.
    but for EXE, if i simply initiate an instance and if i try to play it wont play, i understand that as it will take time for framework to finish initialization, so Play() as below wont work

    CSoundPlayer *iSoundPlayer = CSoundPlayer::NewL(
    _L("C:\\System\\Apps\\Otran\\Siren.wav"));
    iSoundPlayer->Play();


    So instead i went for Active Objects as
    CActiveAudioEngine :: CActiveAudioEngine() : CActive(0)
    {
    CActiveScheduler::Add(this);
    }
    void CActiveAudioEngine ::RunL()
    {
    CActiveScheduler::Stop();
    }
    void CActiveAudioEngine :oCancel()
    {

    }

    void CActiveAudioEngine::Start()
    {
    iSoundPlayer = CSoundPlayer::NewL(
    _L("C:\\System\\Apps\\Otran\\Siren.wav"));
    SetActive();
    CActiveScheduler::Start(); //only if i add this MapcInitComplete(..) is Called back
    iSoundPlayer->Play(); // This play doesnt works to play but if i put play in MapcInitComplete(..) it plays once, but MapcPlayComplete(..) is never getting called
    }
    CActiveAudioEngine::~CActiveAudioEngine()
    {
    if(iSoundPlayer)
    delete iSoundPlayer;
    }

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: EXE Audi playing problem

    Does this problem occur on the target device or in the emulator?
    In the latter case note that pre-3rd edition emulators run .exe-s in a restricted environment (the blue-background one), which is not capable of displaying graphics, playing sounds, etc.

  5. #5
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    210

    Re: EXE Audi playing problem

    hey the audio is playing, but i am facing other problems only. Somethings like MapcPlayComplete(..) never getting called.

  6. #6
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    210

    Re: EXE Audi playing problem

    if i delete the instance CSoundPlayer and create a new instance for every time to play the task of playing it multiple times by having in a loop works, but is there any way for doing it with same instance so no overhead will be there of creation and deletion of object

  7. #7
    Registered User
    Join Date
    Jul 2012
    Posts
    22

    Re: EXE Audi playing problem

    Hi gs_cmans

    I am facing same problem.
    Audio is playing in GUI application but not in exe on device.

    Can you please tell me what you did to solve this problem

    Thanks in advance.

  8. #8
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,956

    Re: EXE Audi playing problem

    I think you resolved that already here : http://www.developer.nokia.com/Commu...-in-background & now the issue is to repeat the audio?

  9. #9
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: EXE Audi playing problem

    Quote Originally Posted by akshay.raikwar View Post
    Hi gs_cmans

    I am facing same problem.
    Audio is playing in GUI application but not in exe on device.

    Can you please tell me what you did to solve this problem

    Thanks in advance.
    I would think that, Your problems are really different. also as you already have active threads, then please do hijac other active treads, since it make it really hard to concentrate on the original problem.

  10. #10
    Registered User
    Join Date
    Jul 2012
    Posts
    22

    Re: EXE Audi playing problem

    Sorry i messed up with the thread.

    found solution for repeat problem.

    with SetRepeate() API

    Thanks everyone

Similar Threads

  1. Problem MMC+USB Connection
    By Fede81 in forum Symbian
    Replies: 1
    Last Post: 2007-06-14, 06:13
  2. Problem MMC+USB Connection
    By Fede81 in forum General Development Questions
    Replies: 3
    Last Post: 2006-07-19, 15:21
  3. A problem with capturing Keypress in EXE
    By ahmadgamal in forum Symbian
    Replies: 0
    Last Post: 2005-12-15, 10:06
  4. Problem playing 3gp video clip in 3650
    By marieG in forum Mobile Java General
    Replies: 0
    Last Post: 2003-04-24, 12:09
  5. problem in playing a wav file
    By j2me_raj in forum Symbian
    Replies: 1
    Last Post: 2003-04-18, 11:43

Posting Permissions

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