473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to find dshow devices that are on the computer

IronRazer
83 64KB
I am making a program that uses dshow devices. I need to find the names of the device or devices such as "SoundMAX Digital Audio" or "SoC PC-Camra". How do i get the names and put them into a listbox so i can choose the device i want to use ? I only need the audio devices but i can filter out the rest if i can just figure out how to get the name.

Thank you in advance to those that help me.
Jan 14 '13 #1

✓ answered by IronRazer

After searching for ways to get the audio device names i figured out how to get them using the DirectX SDK. However if someone has any ideas on why the shell command in VB will not let ffmpeg write the text file that would be nice to know. This is not the first time i had that problem.

This is how to get your audio devices :

1. Install DirectX SDK from Microsoft Download Center.
2. Go to Project/Add Resource (.net) tab and select Microsoft.DirectX.Sound

Now use this code to put the names into a combobox.

Expand|Select|Wrap|Line Numbers
  1. Imports Microsoft.DirectX.DirectSound
  2.  
  3. Public Class GetDevices
  4.  
  5.     Private Sub GetDevices_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.         FindDevices()
  7.     End Sub
  8.  
  9.     Public Sub FindDevices()
  10.         Dim AudioDevices As New CaptureDevicesCollection
  11.         For x = 0 To AudioDevices.Count - 1
  12.             ComboBox1.Items.Add(AudioDevices.Item(x).Description)
  13.             End If
  14.         Next
  15.         ComboBox1.SelectedIndex = 0
  16.     End Sub
  17.  
When the form loads it will list devices in the combobox.

Enjoy !!!!

3 3804
PsychoCoder
465 Expert Mod 256MB
Bytes.com isn't a code or homework service, we're a community of like minded people who come together to help those who are willing to help themselves.

Show us what you've tried and we will do everything we can to nudge you in the right direction but we will not just do the work for you.
Jan 14 '13 #2
IronRazer
83 64KB
Sorry for sounding like i want the work done for me, I just need to know how to go about doing this. My program uses ffmpeg and this is how you get the names i need using it. From a standard cmd prompt i can run this ffmpeg command :

Expand|Select|Wrap|Line Numbers
  1. ffmpeg -list_devices true -f dshow -i dummy >info.txt 2>>&1
  2.  
and it writes the output to a text file just fine but, if i run it from a Shell command or by using a Process in vb it runs the command but it fails to write the info to a text file. I have tried several ways using :

Expand|Select|Wrap|Line Numbers
  1. Shell("ffmpeg -list_devices true -f dshow -i dummy >info.txt 2>>&1")
  2.  
All other ffmpeg commands work fine that i send from my program except this one. I even tried having my program run a batch file that works from a cmd prompt but, run from vb cmd shell it fails to make the text file also. Is there some reason that the cmd shell in vb won`t work?
I was told maybe using WMI might work to get the names of devices but, i can`t find a good example anywhere of how to use WMI and don`t quite understand it yet.
Do you know why Shell command dosn`t let ffmpeg write the text file or can you direct me to a good WMI example ?

PS. I am running XP Pro SP3 as the administrator.
Jan 15 '13 #3
IronRazer
83 64KB
After searching for ways to get the audio device names i figured out how to get them using the DirectX SDK. However if someone has any ideas on why the shell command in VB will not let ffmpeg write the text file that would be nice to know. This is not the first time i had that problem.

This is how to get your audio devices :

1. Install DirectX SDK from Microsoft Download Center.
2. Go to Project/Add Resource (.net) tab and select Microsoft.DirectX.Sound

Now use this code to put the names into a combobox.

Expand|Select|Wrap|Line Numbers
  1. Imports Microsoft.DirectX.DirectSound
  2.  
  3. Public Class GetDevices
  4.  
  5.     Private Sub GetDevices_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.         FindDevices()
  7.     End Sub
  8.  
  9.     Public Sub FindDevices()
  10.         Dim AudioDevices As New CaptureDevicesCollection
  11.         For x = 0 To AudioDevices.Count - 1
  12.             ComboBox1.Items.Add(AudioDevices.Item(x).Description)
  13.             End If
  14.         Next
  15.         ComboBox1.SelectedIndex = 0
  16.     End Sub
  17.  
When the form loads it will list devices in the combobox.

Enjoy !!!!
Jan 17 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Anon Email | last post by:
Hi everyone, Let's see, now. This question is about the capabilities of ANSI C++. I want to write and compile code in ANSI C++ that, when compiled, will make the computer speaker beep; or, at...
8
by: pigeon | last post by:
I have 2 users that their client software must be going crazy.. they are sending packets every .02 seconds to the db server... I know this because I stuck a sniffer on teh traffic.. but now i just...
5
by: Frank Skare | last post by:
Hello, can somebody tell why I get 103 errors with /clr and none with /clr:oldSyntax when I include the dshow header file. I would like to use the new syntax. Win32 console app generated by...
0
by: digitalshehan | last post by:
Hi All, I need to find out who are the users connected to a shared folder on my machine at any given time. Its something like what you can find in the Computer Management console (control panel...
2
by: Robert Iver | last post by:
Hello fellow developers, I'm hoping someone out there can steer me down the right path with this little conundrum I have, because I am getting frustrated more and more by the minute. I have a...
2
by: =?Utf-8?B?ZGF2ZS5oYXJkeQ==?= | last post by:
Hi, there have been loads of posts about this problem on loads of forums and I have tried everything suggested (except the stuff I’m not comfortable with like deleting drivers and reg. edits). ...
2
by: subsanta | last post by:
My computer has so many problems and ive looked around on the internet and ive managed to fix some of them. I know that i have a few viruses on my computer, but i cant get rid of them, in one case i...
6
by: ebaxx | last post by:
Can i find a stllen computer through the mac adress, is it possible????Really important to me. Thank u. Looking forward to know the answer
1
by: =?Utf-8?B?VEhOS0lUMjAwOA==?= | last post by:
TRIED TO PUT IN A MUSIC CD TO PLAY FROM OUR LOCAL LIBRARY-NOTHING HAPPENS. TRIED TO FIND CD/DVD DRIVE ON "COMPUTER" AND DIDN'T FIND IT YET I HAVE A DRIVE ON MY LAPTOP. HOW DO FIND ON MY COMPUTER...
2
by: brett | last post by:
ok, it appears that i have run into a spot that i am not able to figure out on my own. Let me first say that i have hobbled together this SUB from things i found on the internet and tutorials....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.