Getting audio input/output with comport as Input
I’ve been bashing my head in for the last 2 days trying to get a problem working. I’m trying to get all sound devices connected to a COMport and then play the audio to them, but for some reason the devices you get from ManagementObjectSearcher("SELECT * FROM Win32_SoundDevice") is completely different from what I would get from NAudio or enumerator.EnumerateAudioEndPoints(DataFlow.Render, DeviceState.Active).
Has anyone ever worked with anything remotely similar?
Because I’ve been getting the Product ID and Vendor ID from the comport and I’m successfully finding it in Win32_SoundDevice, but I cannot for the life of me find anything that matches anything, the name isn’t even the same. It says USB 2.0 DEVICE instead of the actual name
That it has in the windows environment
8 Replies
here's the methods i'm using so far.
BlazeBin - bdtlrvvielqz
A tool for sharing your source code with the world!
I'm using these packages:
System.Management
NAudio
NAudio Core
i found this, where i can use MMDevice.ID to compare
but i'm unsure if i can just compare MMDevice with the comport.
Fuck it ima just say fuck you to NAudio
WMI seems to be the wrong tool for this. It doesnt contain anything that resembles a device name you can see in windows
as i said in #advanced i recommend simply using NAudio
and in there the WASAPI interface
Thanks I will check it out
i just looked around in the WASAPI interface, and yeah it shows me what i need but there's no way for me to see what comport is connected to which sound device. using WMI i can see what comport it is. but i cannot get a way to refrence it with eachother.
does windows just say fuck you to comports and treat them as different ports altogether with zero connections to any other device? or am i going crazy? @Insire
i have no idea. never needed to touch COM anything or even unmanaged code
i just stay in the .NET bubble and let others worry about it
Holy jesus
i got it
EUREKA!
check the link out for my solution
BlazeBin - pugkbnxgqkqs
A tool for sharing your source code with the world!