I’m after any information about setting the device option for recording with portaudio. I’ve been all over the net and can’t find any meaningful way to do this.
I think it’s also unhelpful to tell me to refer to the MBS online documentation as it’s almost unreadable and doesn’t really detail what the commands do.
What I know by studying the PortAudio example.
On m Computer I have 4 devices listed
MME
Windows directshow
ASIO
Windows WASAPI
(I converted some C code and I got this far)
each of these has recording options (i.e microphone, microsoft sound mixer, stereo mix etc…)
these each have their own separate input.
What I want to load my input combobox with is something like
MME : Microphone (realtec High Definition)
and set the celltag as the index of each recording option.
When I start up the app, I’d make a little code to scroll through the code until the defaultinputID= the celltag and set the listindex to that.
Then I want to be able to choose the input source and that would set the device for recording (which I have no idea to do)
I made a copy of port audio and started muck about with it. I was dealing mostly with the input window.
The following code I got stuck on object… but I’m sure it could be much more compact
[code] dim i,c as integer
dim host as PortAudioHostApiInfoMBS
p=new PortAudioMBS
c=p.HostApiCount
for i=0 to c
host=p.HostApiInfo(i)
if host<>Nil then
ListBox1.AddFolder host.name
ListBox1.CellTag(ListBox1.LastIndex,0)=host
end if
next
dim o as Object
dim h as PortAudioHostApiInfoMBS
dim d as PortAudioDeviceInfoMBS
dim a,b as string
dim row as integer=listbox1.ListCount-1
o=ListBox1.CellTag(row,0)
if o=nil then
Return
end if
if o isa PortAudioHostApiInfoMBS then
h=PortAudioHostApiInfoMBS(o)
c=h.deviceCount-1
for i=0 to c
d=p.DeviceInfo(p.HostApiDeviceIndexToDeviceIndex(h.Index, i))
if d<>Nil and d.maxInputChannels>0 then
'ListBox1.AddFolder d.name
'ListBox1.CellTag(ListBox1.LastIndex,0)=d
a = d.name+" : "
end if
next
msgbox a
elseif o isa PortAudioDeviceInfoMBS then
d=PortAudioDeviceInfoMBS(o)
if d.maxInputChannels>0 then
ListBox1.AddRow "HostApiIndex: "+str(d.HostApiIndex)
ListBox1.AddRow "maxInputChannels: "+str(d.maxInputChannels)
ListBox1.AddRow "maxOutputChannels: "+str(d.maxOutputChannels)
ListBox1.AddRow "Index: "+str(d.index)
end if
end if
[/code]