|
Making the call was the easy part
Recording the call is going to be harder. It depends on how you made the call really as to how you can get attached to the audio stream and if your modem even allows you to get it.
Personally I like to keep modems for data communication and not voice. They were not really made for voice.
Tapi is going to be a pain as it really does not work very well with managed code (no matter what anyone says) and the Unimodem TSP does not support full duplex audio.
|
|
|
|
|
Hi all,
Thank You.
Can u tell me the procedure to record a phone Call.
Thanks & Regards
S.Raju
|
|
|
|
|
As I said there is no really simple way to do it using Tapi and managed code but I am not even sure about what interface you are using?
What kind of modem do you have? Is it a modem that has speaker phone functionality or just a plain modem?
Personally I always point folks trying to do voice applications with modems to stop before they put to much work in and make the step to real telephony hardware that is built to do this stuff.
Let me know if you are ready for that. Its not cheap but I can help out a bit with the programming aspect.
|
|
|
|
|
Hi all,
Thank u for giving Reply to My Question. I am using smart link 56k internal voice modem,this modem is not having speaker phone functionality. I have written code in VB 6.0 using MSCOMM control. By using properties of this control i am dialing a phone number through MODEM,it is working fine.Now i want to record this call, could u please tell me how i can Record the Phone call.
Thanks & Regards
S.Raju.
|
|
|
|
|
Oh,
You cant do this using MSCOMM. That control only lets you talk to the modem and use it for data communications. It doe snot provide you with an Audio stream as you think it does. It interfaces to a com port and allows you to send/receive data. The underlying audio stream is still managed by the hardware itself.
To get to the voice path in any way you are going to need to talk to the hardware at a lower level. I suggest that you start digging into Tapi a bit. There are some great resources out there to help people get started there. Just do a Google search for 'Tapi FAQ' and start reading.
Be aware that Tapi is not for the faint of heart nor does it interface really well with VB. It makes use of callbacks and some very touchy data structures that can cause a VBer much pains. It may be better for you to start looking for an ActiveX control that abstracts all the junk into something a bit more COM based.
Either way you are going to have to start dealing with media streams to get the audio data you want, and once again, if you are trying to use this modem to make a call on your behalf and want to record the entire conversation (what you are speaking and what the other person is speaking, you are going to run into some issues because the Unimodem TSP is not full-duplex. Remember the fact that these modems do voice at all is really an afterthought. They were first and foremost data communications devices. Companies trying to shoehorn speakerphones and answering machines into them was just to build some added value for consumers, not to provide a feature rich application development environment for software devs to write applications on. If you are writing for anything other than personal use, trust me, don't bother using a modem.
|
|
|
|
|
any one can help for that:-
actually i want to select any line from 1st text file and want to paste for it in to the second text file.
|
|
|
|
|
You can't. You can read any line you want, then you need to read the second text file, insert the line, then write the entire file. You can't just insert a line into a file.
VB2005 has My.FileSystem to do this stuff with. But, it makes more sense to use System.IO.File.ReadAllText and WriteAllText directly, so you know where it is if you ever need to use C#.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
actually my problem is diffent.
Actually i want read a line from 1st text file and search this line in the second text file( which had the string as in 1st txt file and equivalent localized string) and then copy this localized string from 2nd text file and replace with the 1st one.
Thanks in advance!
pankaj kumar
|
|
|
|
|
Your problem is the same. You still can't replace text in a file, you still need to read all of the file in, change it in memory and save it all out again.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a need of importing the .DAT files into the application.
The first row in the file is considered as header and rest for data, The data is seperated by TABDelimiter.
Any suggestions plz....
Help....
Jats
|
|
|
|
|
There are a plethora of articles on this site for dealing with CSV files. Take one and replace the comma with a tab.
|
|
|
|
|
I had tried that before, but its not working.
As the file type is .DAT, there is some problem with the connection string b'cause when i opened the connection and tried to assaign the data to a datagridview its throwing an error stating "ERROR [42000] [Microsoft][ODBC Text Driver] Cannot update. Database or object is read-only."
The code is as follows....
Private Sub ConnectDAT()
ds = New DataSet()
Dim sql_select As String
Dim strConn As String = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + TextBox1.Text.Trim() + ";Extensions=asc,csv,tab,txt;Persist Security Info=False"
' The connection string is given as "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=D:\Folder;Extensions=asc,csv,tab,txt;Persist Security Info=False"
Dim conn As OdbcConnection
conn = New System.Data.Odbc.OdbcConnection(strConn.Trim)
conn.Open()
sql_select = "select * from [" + strCSVFile + "]"
obj_oledb_da1 = New System.Data.Odbc.OdbcDataAdapter(sql_select, conn)
obj_oledb_da1.Fill(ds, "CInfo")
DataGridView1.DataSource = ds
DataGridView1.DataMember = "CInfo"
conn.Close()
End Sub
Can you help me...in solving the problem...
Jats
|
|
|
|
|
Jats_4ru wrote: As the file type is .DAT
The file extension has nothing to do with it. It is the contents for the file that are important. You have described a tab separated file.
Jats_4ru wrote: there is some problem with the connection string b'cause when i opened the connection and tried to assaign the data to a datagridview its throwing an error stating "ERROR [42000] [Microsoft][ODBC Text Driver] Cannot update. Database or object is read-only."
Why are you using an ODBC connection at all? There are hundred of examples of a CSV reader, quite a few here on CodeProject, that work perfectly well without resorting to inefficient kludges like ODBC. Look for those projects and change the comma to a tab (like I already suggested)
|
|
|
|
|
Hi everyone!
I'm relatively new to VB.NET and I want to write a resistance evaluation tool for school.
How do I check which value of a combobox is selected?
And can I give the different values different background colours?
|
|
|
|
|
|
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
Public Sub StartButton(ByVal show As Boolean)
Dim primo As Long
Dim ultimo As Long
primo = FindWindow("Shell_TrayWnd", "")
ultimo = FindWindowEx(primo, 0, "Button", vbNullString)
If show = True Then
ShowWindow(ultimo, 5) 'show start button
Else
ShowWindow(ultimo, 0) 'hide start button
End If
End Sub
Public Sub taskbar(ByVal show As Boolean)
Dim primo As Long
primo = FindWindow("Shell_traywnd", "")
If show = True Then
SetWindowPos(primo, 0, 0, 0, 0, 0, SWP_SHOWWINDOW) 'show taskbar
Else
SetWindowPos(primo, 0, 0, 0, 0, 0, SWP_HIDEWINDOW) 'hide taskbar
End If
End Sub
Public Sub deskicon(ByVal show As Boolean)
Dim primo As Long
primo = FindWindowEx(0&, 0&, "Progman", vbNullString)
If show = True Then
ShowWindow(primo, 5) 'show desktop icon
Else
ShowWindow(primo, 0) 'hide desktop icon
End If
End Sub
|
|
|
|
|
Is this VB6 ? It looks like a bunch of p/invoke code. go to www.pinvoke.net to find out how to do the pinvoke part, and the rest is trivial.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Does anyone knows how to detect memory card/storage card from a smart device using vb.net CF ? The challenge is because there are many brands and versions of PDA, means that the naming of the storage device might be different as well. I want to get the drive name of the storage device. Thanks in advance
i wish to learn more from this forum
|
|
|
|
|
is there a way to check the remaining free space availabe on the Hard Disk and notify the user of that?
I mean how can i display a popup msg to the user when the free remaining size reaches 90% for example?
Regards
Ramy
|
|
|
|
|
|
Try this. In this example you will need one button and 3 textboxes.Hope this helps
Declareations
Inherits System.Windows.Forms.Form<br />
Private Declare Function GetDiskFreeSpaceEx _<br />
Lib "kernel32" _<br />
Alias "GetDiskFreeSpaceExA" _<br />
(ByVal lpDirectoryName As String, _<br />
ByRef lpFreeBytesAvailableToCaller As Long, _<br />
ByRef lpTotalNumberOfBytes As Long, _<br />
ByRef lpTotalNumberOfFreeBytes As Long) As Long<br />
<br />
<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
TextBox1.Text = GetFreeSpace("C:\")<br />
TextBox2.Text = GetTotalSpace("C:\")<br />
GetPercentageFree()<br />
If TextBox3.Text < 36 Then<br />
MsgBox("You are running out of space")<br />
End If<br />
End Sub<br />
Public Function GetFreeSpace(ByVal Drive As String) As Long<br />
'returns free space in MB, formatted to two decimal places<br />
'e.g., msgbox("Free Space on C: "& GetFreeSpace("C:\") & "MB")<br />
<br />
Dim lBytesTotal, lFreeBytes, lFreeBytesAvailable As Long<br />
<br />
Dim iAns As Long<br />
<br />
iAns = GetDiskFreeSpaceEx(Drive, lFreeBytesAvailable, _<br />
lBytesTotal, lFreeBytes)<br />
If ians > 0 Then<br />
<br />
Return BytesToMegabytes(lFreeBytes)<br />
Else<br />
Throw New Exception("Invalid or unreadable drive")<br />
End If<br />
<br />
<br />
End Function<br />
<br />
<br />
Public Function GetTotalSpace(ByVal Drive As String) As String<br />
'returns total space in MB, formatted to two decimal places<br />
'e.g., msgbox("Free Space on C: "& GetTotalSpace("C:\") & "MB")<br />
<br />
Dim lBytesTotal, lFreeBytes, lFreeBytesAvailable As Long<br />
<br />
Dim iAns As Long<br />
<br />
iAns = GetDiskFreeSpaceEx(Drive, lFreeBytesAvailable, _<br />
lBytesTotal, lFreeBytes)<br />
If iAns > 0 Then<br />
<br />
Return BytesToMegabytes(lBytesTotal)<br />
Else<br />
Throw New Exception("Invalid or unreadable drive")<br />
End If<br />
End Function<br />
<br />
Private Function BytesToMegabytes(ByVal Bytes As Long) _<br />
As Long<br />
<br />
<br />
Dim dblAns As Double<br />
dblAns = (Bytes / 1024) / 1024<br />
BytesToMegabytes = Format(dblAns, "###,###,##0.00")<br />
<br />
End Function<br />
Public Function GetPercentageFree()<br />
Dim free As Integer<br />
Dim total As Integer<br />
Dim percent As Integer<br />
free = GetFreeSpace("C:\")<br />
total = GetTotalSpace("C:\")<br />
<br />
percent = (free / total) * 100<br />
TextBox3.Text = percent<br />
End Function
|
|
|
|
|
Dim strPath As String = "C:\Video"<br />
Dim strSearch As String = ".avi"<br />
<br />
<br />
For Each strFile As String In My.Computer.FileSystem.GetFiles(strPath, FileIO.SearchOption.SearchTopLevelOnly, strSearch)<br />
<br />
ListBox1.Items.Add(My.Computer.FileSystem.GetName(strFile))<br />
Next
Can somebody tells me why it won't populate my listbox with avi files in C:\Video? Can somebody fix the code here?
|
|
|
|
|
What happens when you step through the code ? Should the search string be *.avi ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sorry I had to redesign some of your code but it should work.
Dim strPath() As String <br />
Dim strSearch As String <br />
strPath = IO.Directory.GetFiles("C:\video")<br />
<br />
For Each strSearch In strPath<br />
If InStr(strSearch, ".avi", CompareMethod.Text) Then<br />
ListBox1.Items.Add(strSearch)<br />
End If<br />
Next
Tell me if it does
Hope this helps
|
|
|
|
|
Sorry guys for the late reply, actually the code I pasted before does work. There was something wrong with my listbox properties so that the files found isn't visible on the listbox. I deleted the listbox and create a new one and now it runs fine Sorry again..
Thanks anyway
|
|
|
|
|