×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    94

    Problem with Playing wav file

    Hi,
    I am novice to Symbian development. I want to play sound file after 'Play' option selected. but it is not Playing.. I am using PlayUtility.cpp Can anybody help me..I am ready to show my code also..
    Last edited by amitgawali; 2010-03-27 at 04:55.

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

    Re: Problem with Playing wav file

    basically you could try out the wiki examples, and then do check with debugging on what is happening when your code is executed.

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    94

    Re: Problem with Playing wav file

    Actually while debugging my application it goes like this once initialization of player,i call MapCInitcomplete in this way

    void CPlayerContainer::PlayFile()
    {
    _LIT(aFileName,"E:\\ding.wav");

    iPlayerUtility=CPlayerUtility::NewL(aFileName);//Player initialization
    iPlayerUtility->MapcInitComplete(0,TTimeIntervalMicroSeconds());
    }
    the control goes well over this code to MapcInitComplete the code for MapcInitComplete is:
    void CPlayerUtility::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
    {
    if(aError == KErrNone)
    {
    iPrepared = ETrue;
    iPlayUtility->SetVolume(iPlayUtility->MaxVolume());
    //play the file immediately
    iPlayUtility->Play();

    }
    }

    problem arises when I reach this line iPlayUtility->SetVolume(iPlayUtility->MaxVolume()); so I decided to add these two functions implemetation as they are declared virtual,bt didnt work out too:
    TInt CPlayerUtility::MaxVolume()
    {
    return 10;
    }
    void CPlayerUtility::SetVolume(TInt aVolume)
    {
    aVolume=MaxVolume();
    }

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Problem with Playing wav file

    Note that MapcInitComplete is a callback, which is going to be called by the 'OS', when your ding.wav is really ready to play. That volume thing sets a variable of yours to some value. It might make sense, but probably it does not.
    For a compressed example see #3 of http://discussion.forum.nokia.com/fo...d.php?t=125891

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    94

    Re: Problem with Playing wav file

    Thanks for reply it worked fine.

Similar Threads

  1. Problem with pyobfuscate
    By JOM in forum Symbian
    Replies: 3
    Last Post: 2008-06-20, 22:47
  2. problem when importing from carbide c++ to vs 2003!
    By misfit.physics in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-02-19, 09:45
  3. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Symbian
    Replies: 35
    Last Post: 2008-01-17, 09:12
  4. Problem in playing in an audio file.
    By PankajNeve in forum Symbian
    Replies: 3
    Last Post: 2007-03-09, 13:52

Posting Permissions

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