Listening voice of one channel from another channel

rated by 0 users
This post has 1 Reply | 1 Follower

Not Ranked
Posts 5
Points 55
Talukder Posted: 03-11-2010 5:21 AM

Hello everybody,

I wanna listen a voice file being played in a channel from another channel that I am currently connected to after calling.

Is it possible?

If possible how can I do this? which function should I use and in which order?

  • | Post Points: 5
Not Ranked
Posts 5
Points 55

ok I have done that. But a problem occurs. I am listening the voice or background music and accordingly I am singing.But the dx_mreciottdata which is supposed to record from two timeslots is recording from only my channel where i am singing. it is not recording from both channels. the recorded file consists only my song ..no backgound music........I have used the following code

int VoiceChannel::karaoke(char* filename)
{
    printf("\n Entering karaoke");
    int  recfh;
       SC_TSINFO       tsinfo11,tsinfo1,tsinfo22 ,tsinfo2, tsinfo;
        long            scts1,scts11,scts22,scts2;
        long            tslots[2];
      
        DX_IOTT         iott[1];
        DV_TPT          tpt;
        int             ret;
        GC_INFO         error;
        char devname1[140]="";
     

   
    DX_XPB xpb_wav = {  FILE_FORMAT_WAVE, 
                    DATA_FORMAT_PCM, 
                    DRT_11KHZ, 
                    8
                    };

    /* seek to the end of the file and record message */
#ifdef _WIN32
    if ( ( recfh = dx_fileopen( filename, O_RDWR | O_TRUNC | O_CREAT, 0666 ) )
#else /* !_WIN32 */
    if ( (recfh = open(filename, O_RDWR | O_TRUNC | O_CREAT, 0666))
#endif /* _WIN32 */
        == -1) {
        printf("Error opening file %s\n","record");
        return(-1);
    }

    /*
        * Clear and Set-Up the IOTT strcuture
        */
        tsinfo11.sc_numts = 1;
        tsinfo11.sc_tsarrayp = &scts11;
        dx_getxmitslot(voiceh,&tsinfo11);
        tsinfo1.sc_numts = 1;
        tsinfo1.sc_tsarrayp = &scts1;
        ret =  gc_GetXmitSlot(ldev, &tsinfo1);
        if (ret != GC_SUCCESS)  {
                gc_ErrorInfo(&error);
                printf("\n ErrorInfo == %s",error.gcMsg );
                return (-1);
        }
        tsinfo22.sc_numts = 1;
        tsinfo22.sc_tsarrayp = &scts22;
        dx_getxmitslot(voiceh1,&tsinfo22);
        tsinfo2.sc_numts = 1;
        tsinfo2.sc_tsarrayp = &scts2;
        ret = gc_GetXmitSlot(ldev1, &tsinfo2);

        if (ret != GC_SUCCESS)  {
                gc_ErrorInfo(&error);
                 return (-1);
        }


        tslots[0] = scts1;
        tslots[1] = scts2;
       
        tsinfo.sc_numts = 2;
        tsinfo.sc_tsarrayp = &tslots[0];
   


    //memset( iott, 0, sizeof( DX_IOTT ) );

    iott[ 0 ].io_type    = IO_DEV | IO_EOT;
    iott[ 0 ].io_fhandle = recfh;
    iott[0].io_offset = 0;
    iott[0].io_length = -1;
    iott[0].io_offset = IO_EOT;

    /*
        * Clear and then Set the DV_TPT structures
        */
    //memset( tpt, 0, (sizeof( DV_TPT ) * 3) );

    /* Terminate Record on Receiving any DTMF tone */
     dx_clrtpt (&tpt,1);
        tpt.tp_type = IO_EOT;
        tpt.tp_termno = DX_MAXDTMF;
        tpt.tp_length = 1;
        tpt.tp_flags = TF_MAXDTMF;
        tpt.tp_nextp = NULL;
       
     
  
          
        if(dx_listen(voiceh,&tsinfo2)  == -1)
          printf("\n ..............dx_listen failed..............");
        else
          printf("\n ..............dx_listen Success..............");
         if((gc_Listen(ldev, &tsinfo22, EV_SYNC) == -1))
            printf("\n gc_Listen failed........ ");
        else
            printf("\n gc_Listen success........ ");

// Recording starts  from voiceh(the called channel where caller will sing) and from voiceh1 where a background music is being played. But the function is recording only my song no background music.//
        ret = dx_mreciottdata(voiceh, &iott[0], &tpt, &xpb_wav, RM_TONE, &tsinfo);
            //ret = dx_mreciottdata(voiceh, &iott[0], &tpt, &xpb_wav, (unsigned short)(RM_TONE|EV_SYNC), &tsinfo);
         //dx_reciottdata(voiceh2, &iott[0], &tpt, &xpb_wav, PM_TONE | EV_ASYNC);

        if(ret == 0)
        {
            printf("////////////dx_mreciottdata   success/////////////");
            return(0);
        }
        else
        {
            printf("\n///////////dx_mreciottdata   failed/////////////");
            printf("\n Error = %s",ATDV_ERRMSGP(voiceh));
            return(-1);
        }


   
}

What can I do?

  • | Post Points: 5
Page 1 of 1 (2 items) | RSS