Forum

Results 1 to 5 of 5
  1. #1
    Join Date
    October 2014
    Posts
    64

    C# Connection.PlaybackDevice

    Something else that I can't work out, but is probably an easy question for someone.

    I'd like to display a list of all Playback and Capture devices, so that the end user can select which ones to use.
    Similar to how the main Teamspeak client works.

    Do I need to gain these from the Operating system or has the TS SDK already got them for me to use?

    If the SDK has them, how would I go about getting them and then set them for use in C#?

    Im using the below to set and display what is in use at the moment.

    Code:
     Connection.OpenCapture();
                Console.WriteLine($"{Connection.CaptureDevice}");
                Connection.OpenPlayback();
                Console.WriteLine($"{Connection.PlaybackDevice}");

  2. #2
    Join Date
    May 2016
    Location
    Idar-Oberstein
    Posts
    152
    That'd be GetPlaybackMode, GetPlaybackDevices asf (https://github.com/TeamSpeak-Systems...ibrary.cs#L225) and handling device changes https://github.com/TeamSpeak-Systems...ibrary.cs#L195.

  3. #3
    Join Date
    October 2014
    Posts
    64
    Thanks thorwe.
    But as a novice, I still have no idea as to how to get the list and then set them.

    I can retrieve a list of devices with a 3rd party lib, but can't get my head around getting them with Teamspeak.

  4. #4
    Join Date
    October 2014
    Posts
    64
    Well I'm still stuck in that I can't work out how to get the sound devices from Teamspeak and set them.

    I'm populating a comboBox on a C# form with the playback and capture devices using the code below.

    Code:
    MMDeviceEnumerator enumerator = new MMDeviceEnumerator();
                foreach (MMDevice device in enumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.All))
                {
                    microphone.Items.Add(device.FriendlyName);
                }
    
                foreach (MMDevice device in enumerator.EnumerateAudioEndPoints(DataFlow.Render, DeviceState.All))
                {
                    speakers.Items.Add(device.FriendlyName);
                }
    Is there a way I can set the OpenCapture and OpenPlayback using the method above?

    Connection.OpenCapture(WHAT GOES HERE?);

    I have looked over the SDK documentation and came across GetPlaybackMode and GetPlaybackDevices as thorwe suggested, but I can't work out how to use them?

  5. #5
    Join Date
    October 2014
    Posts
    64
    Cracked it.
    Using Library.GetPlaybackMode and Library.GetPlaybackDevices.

    Thanks for pointing me in the right direction thorwe.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hearing microphone/CustomCaptureData through PlaybackDevice
    By Mike Holland in forum General Questions
    Replies: 0
    Last Post: April 16th, 2015, 09:05 PM
  2. Replies: 1
    Last Post: November 6th, 2014, 04:10 PM
  3. Connection and connection lost problems.
    By Kalic in forum Windows
    Replies: 1
    Last Post: July 16th, 2012, 12:31 PM
  4. Replies: 3
    Last Post: February 10th, 2011, 12:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •