Generally speaking, only old people year old times… since I am olmost 66 yo (programming since 1979) it might be so in my case.
I am trying to select a microphone for recording. Natively it seems that MoviePlayer plugin is a player only, not as VB whereas the MMControl is capable of recording audio.
At once the search “xojo audio recoring” show this article that, definitly works, thanks!
[Eugene Dakin] (https://forum.xojo.com/u/Eugene_Dakin)
I kind of woke up the also year times, but very much happy to find the the Xojo community helps the way VB5 and VB6 people made VB strong.
Tested, the procedure recorded from a webcam microphone, which was no the prefered device, In fact, not even changing the default device in Windows, the recording was still only from the webcam.
Therefor, I begun the search for a waveInGetDevCaps that worked for me in the good old times. Sadly a Ransomware still has my old code jailed!
After fighting a little with the syntaxis differences, I crashed my self with the definition of the Type/End Type then, structure now.
First, the Structure most be created in a kind of wizard, that is not natural, to say the least. But no char, no Long, nor Short types are named as such (or describe its equivalences in Xojo, except for Short).
at an ACTION of a cmd_list PushButton, the following code
Declare Function waveInGetNumDevs Lib "winmm.dll" Alias "waveInGetNumDevs" () As UInt16
// works perfect
Declare Function waveInGetDevCaps Lib "winmm.dll" alias "waveInGetDevCapsA" (_
byval uDeviceId As UInt16, _
lpCaps As App.WAVEINCAPS, _
ByVal uSize As UInt16) _
As UInt16
dim iJ as integer
dim iCount as integer
dim iNames() as string
dim iDeviceNames as string
dim iWAVEINCAPS as APP.WAVEINCAPS //where seems to be the issue is
dim iSize as UInt16
dim iResult as UInt16
iCount = waveInGetNumDevs()
lst_device_in.DeleteAllRows
lst_device_in.addrow "count: " + str(iCount)
iSize=iWAVEINCAPS.Size
for iJ=0 to iCount-1
iResult = waveInGetDevCaps(ij, iWAVEINCAPS,68)
for iK=0 to 31
iLabelResult = iLabelResult + str(iWAVEINCAPS.szName(ik))
next
lst_device_in.addrow _
format(iResult,"0000")+ ">" + _
iLabelResult
next
sorry for my old programming style
At the APP open event, the structure is declared
in VB the structure will be declared as follows:
Public Type WAVEINCAPS
wMid As Integer
wPid As Integer
vDriverVersion As Long
szPname As String * MAXPNAMELEN
dwFormats As Long
wChannels As Integer
dwSupport As Long
End Type
But no matter what variable type i use (Uint16, Uint32, Uint64, Integer, Int16, int32 or int64) in any possible combination, works not. Seems to be the same with the Byte (Char) array.
After recognizing the devices in the pc, I only receive zeros. And the label is empty.
Obviusly, I most understant that I am missing some things in regard to the structure and the way variables are declared in Xojo, or the array of bytes within it.
Does any one have an idea of what i am missing?
Thanks in advanced!
Regards