Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Mute API Command: Where is "audio client id"?

Alan
Alan Member ✭✭✭✭

I am trying to format an API command to mute a slice on a specific bound client.

Where do I find, and what is the "audio client id?

I tried the "Client id", which the Flex Server assigns to bound clients, but that did not seem to work??

Alan. WA9WUD


Comments

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Hi Alan, I think that is the slice number. I am away from my computer, but will be able to look at my code soon. I have this working, so I should be able to give you a definitive answer shortly.

  • Alan
    Alan Member ✭✭✭✭

    Len

    Thanks for taking a look when you get home.

    But.....the "audio client id cannot be the slice number, as both are used in the "mute" command.

    C[D]<seq_number>|audio client <id> slice <index> mute <val>
    

    Alan

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    I am wrong... It looks like I always use a Client ID of 0. Regardless of which client I am bound to, if I use Client ID = 0, it always mutes the correct slice (0 or 1 in my 6400). This works regardless of whether I am in MultiFlex mode or not.

    If that does not work, let me know, and I will see if I can do some more looking into how exactly this works.

  • Alan
    Alan Member ✭✭✭✭

    I had the same result using "0" as the audio id.

    I run two clients in my shack using multiplex. So, I also need to "mute" the correct client's slice.

    I am hoping the "audio id" will help me mute the desired client.

    Alan

  • KD0RC
    KD0RC Member, Super Elmer Moderator
    edited August 2021

    Hi Alan, I don't think the Client ID is important as long as you know which slice is which. One Slice will be 0, the other will be 1. I believe that it is based on the order in which they are opened.

    You can capture the Client ID for each logged in station and perhaps use that, but I have not found it necessary because the slice IDs are unique (0 or 1). I don't know if I am just getting away with something here, or if that is how it is designed to work.

    On the other hand, I capture Client ID Client Handle and bind to that ID so that profiles, memories, etc are applied to the proper client when I select them in my menu system.

    So to recap:

    "CD45 | audio client 0 slice 0 mute 1" always mutes slice 0, regardless of which client slice 0 is tied to.

    So if I connect Station-1 first and open one slice, that will be slice 0. If I then connect Station-2 and open a slice, that will be slice 1.

    If I open the stations and slices in the opposite order, then the slice numbers are likewise reversed.

    EDIT: I meant Client Handle, not Client ID, above.

  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator

    Alan,

    I took a “mental health day today and did a nice drive. Always good to clear the mind. Going to get the remnants of the hurricane so good day to work on some programming.

    I will call you tomorrow and we can figure this out. As per our conversation earlier, the slice A can be any slice available in the radio, depending on which client connects first and how many slices the client uses, and order the clients are created. Slice A in client is not always radio slice 0.

    I have an idea. Wire shark and bring up two slices on the Maestro. Push the B slice volume knob to mute slice A. Look at corresponding command sent.

    I can check the TCP API also to see what is listed. One of my upcoming projects has to do with subbing to audio streams.

    By the way, loaded Stephen’s Node Red 0.38 nodes but need to reconfigure my flow to support the MQTT style topics now.

    Fun stuff!

  • Alan
    Alan Member ✭✭✭✭

    I could not find an "audio" id to allow me to direct the mute to the bound client. None of the other ids worked, as Len also found. So, using audio id "0" for now....because it works.

    Making matters more complicated, depending on which client binds first, the appropriate slice index number to use, depends.

    Wanting to use my "Mute" command with my multiplex station, I used the following logic via the Flex API "sub client all" command and response, to determine the correct client and correct Flex Index:

    • determine if the slice is part of the bound client by testing if "gui_client" == "slice_handle"
    • if a bound slice, assign a flex index number (0>>3), based on the Flex "index_letter".
    • if not a bound slice, send an empty message.

    Then use the result to build the Mute API command.

    audio client <id> slice <index> mute <val>
    

    For the curious, Javascript below for Slice A. It's "ugly", but it works.

    Alan. WA9WUD

    ===================

    var gui_handle = global.get("gui_handle")

    var slice_handle = global.get("slice_data.a.client_handle")

    var index_letter = global.get("slice_data.a.index_letter")

    var in_use = global.get("slice_data.a.in_use")

    //Slice A On

    if(in_use == "1"){

      // Bound Client

      if(slice_handle == gui_handle){

        // Slice Letter A

        if(index_letter == "A"){

          msg.payload = "0"

        }

        //Slice Letter B

        if(index_letter == "B"){ 

          msg.payload = "1"   

        }

        //Slice Letter C

        if(index_letter == "C"){

          msg.payload = "2" 

        }

        //Slice Letter D

        if(index_letter == "D"){

          msg.payload = "3" 

        }

      } 

      else{ 

        msg.payload = ""

      }

      //Not Bound Client

      }

    else{

      msg.payload = "" 

    }

    flow.set("mute.slice_a", msg.payload)

    return msg

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    So does your Node Red app show both slices when in MultiFlex mode?

    With my gizmo, I see both. I also use the index letter in my display. If I have both slices open in the same client, I see slices A and B. If I have a slice open in each client, then they are both Slice A. Since my physical buttons always map to slices 0 and 1, it is easy to see which side will mute.

    I have a 6400, so I am delinquent in handling more than two slices. It looks like you are writing code that will work with all 8 potential slices - nice!

    Maybe someone will give me a 6700 so that I can write better code...

  • Alan
    Alan Member ✭✭✭✭

    I ended up wire sharing to find the actual "mute" command. The WiKi is not correct. The actual command is:

    "slice set 0 audio_mute=1"

    Where the set number is the order the slice was opened. It does not matter is using multiplex, or not. Just keep track of the slice open order, and you can direct your mute to that slice.

    I used the pan adapter number and the slice index to determine the slice order number.

    Alan. WA9WUD

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Ahhh... Well, I think I am using an older version of the command in the IW7DMH library. I need to look again to see if there is a "set" command that I missed when I responded earlier.

    Thanks for the update on this.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.