Forum

Results 1 to 3 of 3
  1. #1
    Join Date
    July 2014
    Posts
    2

    [Resolved] microphone on/off with teamspeak sdk

    Hi all,
    I made a project with unity and as I needed voice chat, I downloaded teamspeak sdk. Before including it in my project, I made the server part and client part. It worked great like skype. But after reading all the doc files, I did not found the 2 functions I need:
    First one: in the client part turn on or off the microphone (the only function in the doc is to mute and unmute myself; why not)
    Second one: select one player to talk with
    I know it is 10 code lines but I did not found them in the doc.
    I will appreciate if someone have a link or a piece of code
    tx a lot
    Last edited by nino lassally; July 30th, 2014 at 01:09 PM.

  2. #2
    Join Date
    December 2013
    Posts
    4
    For dealing with the mic I think you should look at the ts3client_setClientSelfVariableAsInt function. Use CLIENT_INPUT_DEACTIVATED for the ClientProperties flag. Look at DeactivationStatus in public_definitions.h for possible values to use. Don't forget to flush the client for updates after setting the value. I think this may accomplish what you want.

    //DEACTIVATE MIC
    if (ts3client_setClientSelfVariableAsInt(serverConnec tionHandlerId, CLIENT_INPUT_DEACTIVATED, INPUT_DEACTIVATED) == ERROR_ok)
    ts3client_flushClientSelfUpdates(serverConnectionH andlerId, NULL);

    //ACTIVATE MIC
    if (ts3client_setClientSelfVariableAsInt(serverConnec tionHandlerId, CLIENT_INPUT_DEACTIVATED, INPUT_ACTIVE) == ERROR_ok)
    ts3client_flushClientSelfUpdates(serverConnectionH andlerId, NULL);

  3. #3
    Join Date
    July 2014
    Posts
    2
    tx for your response Mike,
    when I posted, I did not have the good doc. Just have to download it and find the functions.

    private void OpenCloseEcouteur()
    {
    if(EcouteurOn == true)
    {
    error = ts3client_setClientSelfVariableAsInt(scHandlerID, ClientProperties.CLIENT_OUTPUT_MUTED,1);
    if (error != public_errors.ERROR_ok)
    {
    Debug.Log("Error closing Playback device");
    }
    else
    {
    ts3client_flushClientSelfUpdates(scHandlerID, null);
    EcouteurOn = false;
    Debug.Log("Playback device closed");
    }
    }
    else
    {
    error = ts3client_setClientSelfVariableAsInt(scHandlerID, ClientProperties.CLIENT_OUTPUT_MUTED,0);
    if (error != public_errors.ERROR_ok)
    {
    Debug.Log("Error opening Playback device");
    }
    else
    {
    ts3client_flushClientSelfUpdates(scHandlerID, null);
    EcouteurOn = true;
    Debug.Log("Playback device opened");
    }
    }
    }

    private void OpenCloseMicro()
    {
    if(MicroOn == true)
    {
    error = ts3client_setClientSelfVariableAsInt(scHandlerID, ClientProperties.CLIENT_INPUT_MUTED,1);
    if (error != public_errors.ERROR_ok)
    {
    Debug.Log("Error closing capture device");
    }
    else
    {
    ts3client_flushClientSelfUpdates(scHandlerID, null);
    MicroOn = false;
    Debug.Log("Capture device closed");
    }
    }
    else
    {
    error = ts3client_setClientSelfVariableAsInt(scHandlerID, ClientProperties.CLIENT_INPUT_MUTED,0);
    if (error != public_errors.ERROR_ok)
    {
    Debug.Log("Error opening capture device");
    }
    else
    {
    ts3client_flushClientSelfUpdates(scHandlerID, null);
    MicroOn = true;
    Debug.Log("Capture device opened");
    }
    }
    }

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: August 5th, 2015, 12:48 AM
  2. Teamspeak Microphone Problems.
    By alwaysdead99 in forum General Questions
    Replies: 1
    Last Post: January 3rd, 2014, 08:55 PM
  3. TeamSpeak Microphone disabled
    By alex0095 in forum Client Support
    Replies: 1
    Last Post: September 24th, 2011, 10:06 AM

Posting Permissions

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