How to play a wav file to phone line

Login to reply to this topic.
Fri, 2005-08-19 11:54
Joined: 2005-08-05
Forum posts: 1
Hi
 I'm trying to implement an application in which i need to play a wav file to the telephony line while Answering a Call.
For that initially I Opened the Exisiting Call and Answerd.Meanwhile i initialised the CMdaAudioRecorderUtility to play.
The Flags Are Showing that player is initialised and played but the sound on line is not audible.For That I coded As Follows

//****************This IS My RUNL Code*********************

<code>
void CCallIntercept::RunL()
    {
    _LIT(KMsg, "Run : %U");
    TBuf<32> buf;
    buf.Format(KMsg, iCallState);
    ShowMessage(buf);
        if(iCallState == EWaiting)
          {
             iNotify->Notify();
         ShowMessage(_L("Opening the existing call."));
      Â    if (KErrNotFound == iCall->OpenExistingCall(*iLine,*iCallName) )
      Â    {
            IssueRequest();
      Â    }
      Â    else
      Â    {
         iCallState = EOpenCall;
      Â    }
      }
        if(iCallState == EOpenCall)
        {
            iCallState = EAnswering;
         ShowMessage(_L("Answering incoming call."), ETrue);
            iCall->AnswerIncomingCall(iStatus);
         SetActive();
         return;
      }
      
      if(iCallState == EAnswering)
      {
      ShowMessage(_L("Starts playing."), ETrue);
      Player();   

      }


      else if(iCallState == EPlayCompleted)
      {
         IssueRequest();
         iCall->HangUp(iStatus);
         iCallState = EInitState;
      }

      else if(iCallState == EInitState)
      {
         IssueRequest();
      }
            
   }
</code>

//****************PLayer Code***********************************
<code>

void CCallIntercept::Player()
   {
   if(iAudioIntf)
   {
      if(iAudioIntf->State() != CMdaAudioClipUtility::ENotReady)
         iAudioIntf->Close();
      delete iAudioIntf;
   }
   iAudioIntf = CMdaAudioRecorderUtility::NewL(*this);//, NULL,100);
      
      TRAPD(r,iAudioIntf->OpenFileL(KFileName()));
      
   //Recorder Initialisation
   iAudioIntf->SetAudioDeviceMode(CMdaAudioRecorderUtility::ETelephonyMixed);//EDefault);

          iAudioIntf->SetGain(iAudioIntf->MaxGain());

   // Set the playback position to the start of the file
   iAudioIntf->SetPosition(TTimeIntervalMicroSeconds(0));

   // Set maximum volume for playback
   iAudioIntf->SetVolume(iAudioIntf->MaxVolume());
   
               iAudioIntf->Play();
   IssueRequest();
   }
  </code>


IF Anybody Knows Please Reply

Thanks in advance

  • Login to reply to this topic.