HighTechTalks DotNet Forums  

Urgent,Plz help...Problem with playing wav msg

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Urgent,Plz help...Problem with playing wav msg in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Andisheh
 
Posts: n/a

Default Urgent,Plz help...Problem with playing wav msg - 07-07-2007 , 06:35 AM






Hi,

This is my code:



private TAPI3Lib.TAPIClass m_tapi=null;

private TAPI3Lib.ITAddress m_address=null;

private TAPI3Lib.ITBasicCallControl m_call=null;

ITMediaPlayback pMediaPlayback;

//....

private bool SelectTerminal()

{

try

{

ITTerminal pFileTerm=null;

ITTerminalSupport pTermSup=null;

pTermSup=(ITTerminalSupport)m_address;

pFileTerm=pTermSup.CreateTerminal(TapiConstants.CL SID_String_FilePlaybackTerminal, TapiConstants.TAPIMEDIATYPE_AUDIO,TERMINAL_DIRECTI ON.TD_CAPTURE);

if(pFileTerm==null)

MessageBox.Show("terminal is null");

pMediaPlayback=null;

pMediaPlayback=(ITMediaPlayback)pFileTerm;

object[] s=null;

if(m_strFileName.Length<1)

s=new string[]{"c:\\2.wav"};

else

s=new string[]{m_strFileName};

pMediaPlayback.PlayList=s;

ITCallInfo ci=(ITCallInfo)m_call;

ITBasicCallControl2 cc2=(ITBasicCallControl2)ci;

cc2.SelectTerminalOnCall(pFileTerm);

m_control=(ITMediaControl)pFileTerm;

}

catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

return true;

}

//....

private void OnConnect()

{

m_control.Start();

}

The code gives me an Exception on this line:
pMediaPlayback.PlayList = s;
the exception is: Value does not fall within the expected range
What's that?What should I do?

From http://www.developmentnow.com/g/21_0...rk-interop.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.