Diving into DirectX...the shallow end of the pool
I have been spending a little time trying to figure out how to mess around with some audio settings on my computer programmatically. It's not as easy as it seems. I have renewed respect for game programmers. But then, my game experience starts and ends with Minesweeper, and my game programming experience is even more stunted.
At first, I was thinking registry, then I was thinking WMI, then...I took the plunge into DirectX. I have never looked at any DirectX API in my life, so I have a lot to learn. However, the managed classes are pretty slick even if the documentation could be better. I wrote some VB.NET code to loop through my playback devices and list them in a combobox. Not too sophisticated, but it's a nice little exercice to get started.
Dim devicesCollection As New DevicesCollection
Dim DeviceInfo As DeviceInformation
For Each DeviceInfo In devicesCollection
ComboBox1.Items.Add(DeviceInfo.Description)
Dim pbDevice As Device
pbDevice = New Device(DeviceInfo.DriverGuid)
Next DeviceInfo
I can do a similar thing with capture devices. Additionally, there are some convenient constants you can pass to the constructor to get the default playback (or capture) device.
Now, I need to figure out if I can change settings, change the default device etc. through these APIs.
Rock on.
BTW: Was listening to led zep while working on this...man those songs hold up.
Comments
- Anonymous
June 09, 2009
PingBack from http://hairgrowthproducts.info/story.php?id=1219