473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
2 1867
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is...
2
by: steve | last post by:
Hi, I need to do conditional script "include", but like to pull the code from db instead of a file. How do I do that? Reason: I like to implement some complex regex logic, and make it table...
9
by: Dullme | last post by:
i can hardly know what is the code for this. I have researched palindromes, but unfortunately, I only have read about integers not for characters..I need some help..
8
by: Ulysse | last post by:
Hello, I need to clean the string like this : string = """ bonne mentalit&eacute; mec!:) \n <br>bon pour info moi je suis un serial posteur arceleur dictateur ^^* \n ...
2
by: Angus | last post by:
I am trying to change the selection in Javascript - but this HTML element is not a standard option control. On the web page it looks like a dropdown list - and you click on the right hand down...
5
by: Maria Sudderman | last post by:
I have a prblem with the "onClick" command. onClick="insert('<a href="URI">', '</a>')"> but this is not correct! why? Maria
1
by: manchin2 | last post by:
Hi, Can anybody please provide the information about "&quot" and its use, if possible please provide an example. ...
4
by: thaytu888888 | last post by:
Here is my codes in aspx page: <td colspan="2" class="main_menu" runat="server" onclick='toggleDisplay(<%#Eval("description")%>);'><%#Eval("description")%></td> Here is in "View source": ...
2
by: jmash | last post by:
Suppose I have the following string whch is part of an xml string: String s= "Script Id=&quot;Test&quot; " And I need to get s= "Script Id="Test" " Can anyone tell me how this can acheived? ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.