×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    204

    Play sound not to the loud speaker

    Hi
    After searching info in the forums,
    I managed to play a WAV file after answering a voice call .
    The problem is that the WAV is played to the loud speaker although the loud speaker is off.
    I want the WAV to be played to the user's ear (like a regular voice call is heard) and not to the loud speaker (unless loud speaker is on).
    Please advise - how can I do this ?
    Any Info & Suggestions would be great :-)

    Thank you very much

    Here is the code I use :
    Code:
    // ****** Calling Play method from Active class ******
    CPlaySound * player = new CPlaySound();
    player->Play();
    
    // ****** PLAYSOUND.H ******
    class CPlaySound : public CBase, public MMdaAudioPlayerCallback
    {
    public:
    	virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
    	void Play();
    	virtual void MapcPlayComplete(TInt aError);
    private:
    	CMdaAudioPlayerUtility* iAudioPlayer;
    };
    
    // ****** PLAYSOUND.CPP ******
    void CPlaySound::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration)
    {}
    void CPlaySound::Play()
    {
    	iAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(_L("c:\\system\\data\\test.wav"), *this);
    	iAudioPlayer->SetVolume(iAudioPlayer->MaxVolume());
    	iAudioPlayer->SetPriority(80,EMdaPriorityPreferenceTimeAndQuality);
    	iAudioPlayer->Play();
    }
    void CPlaySound::MapcPlayComplete(TInt aError)
    {}

  2. #2
    Regular Contributor
    Join Date
    Aug 2005
    Posts
    204

    Re: Play sound not to the loud speaker

    The Device is Nokia 6600.

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

    Re: Play sound not to the loud speaker

    Also:
    If I want to start playing the WAV ,
    do some actions with some waiting time between them
    and than stop playing ,
    I get a problem - the WAV stops long before the point I call the Stop command.
    Is there a way to make the WAV play till the Stop command ?
    Thanks again :-)
    Code:
    // This code is used in the Active class
    player->Play();
    iTimer.After(iStatus,1000000);
    User::WaitForRequest(iStatus); // I think that here the WAV stops playing ...
    // Do something
    iTimer.After(iStatus,1000000);
    User::WaitForRequest(iStatus);
    // Do another thing
    iTimer.After(iStatus,1000000);
    User::WaitForRequest(iStatus);
    player->Stop(); // I want the WAV to play right to this point ...
    .
    .
    .
    // **** PlaySound.cpp ****
    void CPlaySound::Play()
    {
    	iAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(_L("c:\\system\\data\\test.wav"), *this);
    	iAudioPlayer->SetVolume(iAudioPlayer->MaxVolume());
    	iAudioPlayer->SetPriority(80,EMdaPriorityPreferenceTimeAndQuality);
    	iAudioPlayer->Play();
    }
    
    void CPlaySound::Stop()
    {
    	iAudioPlayer->Stop();
    }

Similar Threads

  1. Sound play question!!!
    By Gameryf in forum Symbian
    Replies: 1
    Last Post: 2005-04-13, 10:41
  2. sound bug (possibly) on 6610
    By alex_crowther in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2004-02-05, 11:44
  3. Nokia Smart Expert - solve this sound problem
    By tsoh_tan in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-10-30, 04:36
  4. Loud speaker of Nokia 7650
    By miro_minkov in forum Symbian
    Replies: 2
    Last Post: 2002-11-08, 21:45
  5. Sound Play in 7650
    By ajay_sipl in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-10, 10: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
  •  
×