By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,141 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,141 IT Pros & Developers. It's quick & easy.

ITMEDIAPLAYBACK.playlist = "WHAT?" in vb.net

P: n/a
1)I want to play a file when someone dials my phone no
2) also to detect the digit pressed by the caller
can i get any idea how to do this in VB.net using TAPI 3
MSDN provides code snippet of how to play a file in C++
but i am unable to carry this in vb.net
PLEASE help
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
paste the code so we can look at it in C++
"siddiq" <si****@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
1)I want to play a file when someone dials my phone no
2) also to detect the digit pressed by the caller
can i get any idea how to do this in VB.net using TAPI 3
MSDN provides code snippet of how to play a file in C++
but i am unable to carry this in vb.net
PLEASE help

Nov 20 '05 #2

P: n/a
sir i am pasting the C++ code as in MSDN..
The following code snippet illustrates simple playback.

First, use ITBasicCallControl2 to create the terminal for recording. This tells the TSP/MSP that we are going to perform file playback on this call. The TSP/MSP creates a terminal for the application to use, and returns it on success.

ITTerminal *pFilePlaybackTerminal = NULL;

pCall->CreateTerminal(
CLSID_MediaFilePlaybackTerminal,
TD_RENDER,
TAPIMEDIATYPE_MultiTrack,
&pFileTerminal
);
Get the ITMediaPlayback interface pointer from the terminal interface and use it to set the file name to play back.

ITMediaPlayback *pMediaPlayback = NULL;
pFilePlaybackTerminal->QueryInterface(IID_ITMediaPlayback, (void**)pMediaPlayback);

// Allocate the array to hold the playlist.
SAFEARRAYBOUND DimensionBounds[1];
DimensionBounds[0].lLbound = 0;
DimensionBounds[0].cElements = 1; // 1 element in the array
SAFEARRAY *pPlayListArray = NULL;
pPlayListArray = SafeArrayCreate(VT_VARIANT, 1, DimensionBounds);

// Allocate the array variant for the playlist.
Variant PlayListVariant;
VariantInint(&PlayListVariant);
PlayListVariant.vt = VT_ARRAY;
VT_ARRAY(PlayListVariant) = pPlayListArray;

// Put the file name into the array.
VARIANT *pvarArrayEntry;
SafeArrayAccessData(pPlayListArray, (void**)&pvarArrayEntry );

// Allocate the string and put it into the array.
VariantInit(pvarArrayEntry);
pvarArrayEntry.vt = VT_BSTR;
VT_BSTR(pvarArrayEntry) = SysAllocString(L"c:\MyFile");

long lArrayPos = 1;
SafeArrayPutElement(pPlayListArray, &lArrayPos, &pvarArrayEntry );
SafeArrayUnaccessData(pPlayListArray);

// Add other file names and/or IStream(s) to the array.

// Pass the array to the terminal.
pMediaPlayback->put_PlayList(pPlayListArray);

// Select the terminal on call.
pCall->SelectTerminalOnCall(pFilePlaybackTerminal);

// Start playback.
pFilePlaybackTerminal->QueryInterface(
IID_ITmediaControl,
(void**)&pMediaControl);
pMediaControl->Start()

// Playback will stop when the file finishes
// or when the application makes the following call.
pMediaControl->Stop();

// Clean up code
pFilePlaybackTerminal->Release();
pMediaControl->Release();
pMediaPlayback->Release()
Assuming the file contains one audio stream and one video stream, and the call has a capture audio stream and a capture video stream, the file will be played back on the two outgoing streams.
pleaze reply to this
"Brian Henry" wrote:
paste the code so we can look at it in C++
"siddiq" <si****@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
1)I want to play a file when someone dials my phone no
2) also to detect the digit pressed by the caller
can i get any idea how to do this in VB.net using TAPI 3
MSDN provides code snippet of how to play a file in C++
but i am unable to carry this in vb.net
PLEASE help


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.