Advertisement
Ham62

WaveDeviceInfo.bas

Nov 27th, 2017
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "windows.bi"
  2. #include "win\mmsystem.bi"
  3. #include "crt.bi"
  4.  
  5. print "*** WaveIn Devices ***"
  6. Dim as uInteger devs = waveInGetNumDevs()
  7. print "waveIn devices: "; devs; chr(10,13)
  8.  
  9. for dev as uInteger = 0 to devs-1
  10.     Dim as WAVEINCAPS caps
  11.     Dim as MMRESULT result = waveInGetDevCaps(dev, @caps, sizeof(caps))
  12.    
  13.     if (result <> MMSYSERR_NOERROR) then
  14.         print "waveInGetDevCaps failed: returned 0x"+hex(result)
  15.         sleep: system
  16.     end if
  17.    
  18.     'Print out device info
  19.     print "-- waveIn device #";dev;" --"
  20.     print "Manufacturer ID: "; caps.wMid
  21.     print "Product ID: "; caps.wPid
  22.     print "Version: "; caps.vDriverVersion \ 256;".";caps.vDriverVersion mod 256
  23.     print "Product Name: "; caps.szPname
  24.     print "Formats: 0x"; Hex(caps.dwFormats)
  25.     print "Channels: "; caps.wChannels
  26.     print "Reserved: "; caps.wReserved1; chr(10, 13)
  27. next dev
  28.  
  29. print "*** WaveOut Devices ***"
  30. devs = waveOutGetNumDevs()
  31. print "waveOut devices: "; devs; chr(10,13)
  32.  
  33. for dev as uInteger = 0 to devs-1
  34.     Dim as WAVEOUTCAPS caps
  35.     Dim as MMRESULT result = waveOutGetDevCaps(dev, @caps, sizeof(caps))
  36.    
  37.     if (result <> MMSYSERR_NOERROR) then
  38.         print "waveOutGetDevCaps failed: returned 0x"+hex(result)
  39.         sleep: system
  40.     end if
  41.    
  42.     'Print out device info
  43.     print "-- waveOut device #";dev;" --"
  44.     print "Manufacturer ID: "; caps.wMid
  45.     print "Product ID: "; caps.wPid
  46.     print "Version: "; caps.vDriverVersion \ 256;".";caps.vDriverVersion mod 256
  47.     print "Product Name: "; caps.szPname
  48.     print "Formats: 0x"; Hex(caps.dwFormats)
  49.     print "Channels: "; caps.wChannels
  50.     print "Reserved: "; caps.wReserved1
  51.     print "Support: 0x"; caps.dwSupport
  52.     'Print list of supported device functions
  53.     if (caps.dwSupport AND WAVECAPS_LRVOLUME) then print !"\tWAVECAPS_LRVOLUME"
  54.     if (caps.dwSupport AND WAVECAPS_PITCH) then print !"\tWAVECAPS_PITCH"
  55.     if (caps.dwSupport AND WAVECAPS_PLAYBACKRATE) then print !"\tWAVECAPS_PLAYBACKRATE"
  56.     if (caps.dwSupport AND WAVECAPS_VOLUME) then print !"\tWAVECAPS_VOLUME"
  57.     if (caps.dwSupport AND WAVECAPS_SAMPLEACCURATE) then print !"\tWAVECAPS_SAMPLEACCURATE"
  58.     print !"\n";
  59. next dev
  60. sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement