Hey Ian, looks like most of my code is working, but I am having trouble with this:
Private _ChosenChannel As Integer
Public Property ChosenChannel As Integer
Get
Return _ChosenChannel
End Get
Set(value As Integer)
_ChosenChannel = value
Dim DeviceIndex As Integer
If ChosenChannel = 1 Then 'get recording device index
DeviceIndex = MainModule.LayerVM.SettingsViewModel.MikrofonIndex
ElseIf ChosenChannel = 0 Then
DeviceIndex = MainModule.LayerVM.SettingsViewModel.LineInIndex
End If
Bass.BASS_RecordFree()
Bass.BASS_RecordInit(DeviceIndex)
Debug.WriteLine("recordinit: " & Bass.BASS_ErrorGetCode.ToString) 'returns BASS_OK
Dim info As BASS_RECORDINFO = Bass.BASS_RecordGetInfo()
Debug.WriteLine("recordinfo: " & Bass.BASS_ErrorGetCode.ToString) 'returns BASS_OK
Qualitaet = ParseDeviceInfo(info)
RaisePropertyChanged()
End Set
End Property
Private Function ParseDeviceInfo(argInfo As BASS_RECORDINFO) As List(Of String)
Dim retList As New List(Of String) 'initialize list
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_1M08) Then retList.Add("11025 Hz, Mono, 8 Bit") 'check if flag is set
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_1S08) Then retList.Add("11025 Hz, Stereo, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_1M16) Then retList.Add("11025 Hz, Mono, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_1S16) Then retList.Add("11025 Hz, Stereo, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_2M08) Then retList.Add("22050 Hz, Mono, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_2S08) Then retList.Add("22050 Hz, Stereo, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_2M16) Then retList.Add("22050 Hz, Mono, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_2S16) Then retList.Add("22050 Hz, Stereo, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_4M08) Then retList.Add("44100 Hz, Mono, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_4S08) Then retList.Add("44100 Hz, Stereo, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_4M16) Then retList.Add("44100 Hz, Mono, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_4S16) Then retList.Add("44100 Hz, Stereo, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_48M08) Then retList.Add("48000 Hz, Mono, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_48S08) Then retList.Add("48000 Hz, Stereo, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_48M16) Then retList.Add("48000 Hz, Mono, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_48S16) Then retList.Add("48000 Hz, Stereo, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_96M08) Then retList.Add("96000 Hz, Mono, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_96S08) Then retList.Add("96000 Hz, Stereo, 8 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_96M16) Then retList.Add("96000 Hz, Mono, 16 Bit")
If argInfo.WaveFormat.HasFlag(BASSRecordFormat.WAVE_FORMAT_96S16) Then retList.Add("96000 Hz, Stereo, 16 Bit")
Return retList
End Function
I am trying to list the properties (sample rate, number of channels, bits per sample) of my recording devices in order to get the rest of my code right.
However, I will always get WAVE_FORMAT_UNKNOWN, no matter which device I choose, and I have six recording devices attached...
There is no error happening though...
Do you have any idea what the problem is?