I have written a WPF application which is capturing display and sound from TV Card from with through C# code. I can get the display from TV card, but I can't get any sound from TV Card. BTW, I'm using .NET framework 3.5 with Visual Studio 2010. My question is how can I get the sound from the TV card?
Lastly, I tried anything like below by using DirectSound library of DirectX. However, I got the following errors.
'Microsoft.DirectX.DirectSound.Device.SetCooperativeLevel(System.Windows.Forms.Control,
Microsoft.DirectX.DirectSound.CooperativeLevel)'
has some invalid
arguments.'Wpfvideo.MainWindow'
to
'System.Windows.Forms.Control'
Code:
private DS.Device soundDevice;
private SecondaryBuffer buffer;
private ArrayList soundlist = new ArrayList();
private void InitializeSound()
{
soundDevice = new DS.Device();
soundDevice.SetCooperativeLevel(this, CooperativeLevel.Priority);
BufferDescription description = new BufferDescription();
description.ControlEffects = false;
buffer = new SecondaryBuffer(CaptureDeviceName, description, soundDevice);
buffer.Play(0, BufferPlayFlags.Default);
SecondaryBuffer newshotsound = buffer.Clone(soundDevice);
newshotsound.Play(0, BufferPlayFlags.Default);
}
This USB-C hdmi capture card can be compatible with all 1080P 720P hdmi device, such as Wii U, PS4, PS3, Xbox One, Xbox 360, Wii, Nintendo Switch, DVD, camera, ZOSI security camera, DSLR and set top box etc.
Make sure the sound output of the computer is not low or muted. 2. In the Game Capture Software, make sure the game sound dial is not set too low. Both Game Capture HD and 4K Capture Utility software support analog audio capture from specific capture devices.
Try this:
var windowInteropHelper = new WindowInteropHelper(this);
soundDevice = new DS.Device();
soundDevice.SetCooperativeLevel(windowInteropHelper.Handle, CooperativeLevel.Priority);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With