# Audio vendor Service

- [API reference](https://docs.qualcomm.com/doc/80-41102-2/topic/_doxygen_rst_file__doxygen_sources_taf_audioVendor_interface_h.html#file-taf-audiovendor-interface-h)

The Audio vendor service APIs help to do audio operations on the audio devices.

## IPC interfaces binding

The following example illustrates how to bind to the Audio vendor service.

bindings:
    {
        clientExe.clientComponent.taf_audioVendor -> tafAudioSvc.taf_audioVendor
    }
    Copy to clipboard

## HW device APIs

TelAF Audio vendor Service helps the user to set/get audio device setting like audio device type power state, mute state using HW device APIs. User can also set the configurations for audio devices, can register for node state change events.

### Send audio configuration to vendor

const char* configurePath = "/data/configure.xml";
     le_result_t res = taf_audioVendor_SendVendorConfig(configPath);
     if(res == LE_OK)
         LE_INFO("Successfully sent the configuration to VHAL");
    Copy to clipboard

### Get the type of audio device connected to the node

le_result_t res = taf_audioVendor_GetNodeType(0x1, &nodeType);
     if(nodeType != TAF_AUDIOVENDOR_INVALID)
         LE_INFO("Successfully got the audio device type");
    Copy to clipboard

### Send audio device configuration to vendor

const char* configurePath = "/data/audioConfigure.xml";
     le_result_t res = taf_audioVendor_SendNodeVendorConfigure(configurePath);
     if(res == LE_OK)
         LE_INFO("Successfully sent the audio device configuration to Vendor");
    Copy to clipboard

### Set/get audio device power state

le_result_t res = taf_audioVendor_SetNodePowerState(0x1, TAF_AUDIO_SUSPEND);
     if(res == LE_OK)
         LE_INFO("Successfully set the audio device power state");
    
     taf_audioVendor_NodePowerState_t state;
     res = taf_audioVendor_GetNodePowerState(0x1, &state);
     if(res == LE_OK)
         LE_INFO("Successfully got the audio device power state %d", state);
    Copy to clipboard

### Set/get audio device mute state

le_result_t res = taf_audioVendor_SetNodeMuteState(0x1, true);
     if(res == LE_OK)
         LE_INFO("Successfully set the audio device mute state");
    
     bool state;
     res = taf_audioVendor_GetNodeMuteState(0x1, &state);
     if(res == LE_OK)
         LE_INFO("Successfully got the audio device mute state %s", state ? "true" : "false");
    Copy to clipboard

### Register/deregister audio device state change

static void NodeStateChangeCallback(uint8_t nodeId, taf_audioVendor_Event_t event,
     void* contextPtr)
     {
         LE_INFO("Received node state change callback for audio device %d for event %d",
         nodeId, event);
     }
    
     taf_audioVendor_NodeStateChangeHandlerRef_t handlerRef;
     handlerRef = taf_audioVendor_AddNodeStateChangeHandler(0x1, NodeStateChangeCallback, NULL);
     if(handlerRef != NULL)
         LE_INFO("Successfully registered for node state change callback");
    
     // To deregister for node state change.
     taf_audioVendor_RemoveNodeStateChangeHandler(handlerRef);
    Copy to clipboard

### Set/get audio device gain percent ranged from 0 to 1

double gainPerc = 0.5;
     double getGainPerc;
     taf_audioVendor_Direction_t direction = TAF_AUDIOVENDOR_RX;
     le_result_t res = taf_audioVendor_SetNodeGain(0x1, direction, gainPerc);
     if(res == LE_OK)
         LE_INFO("Successfully set the gain to audio device");
    
     res = taf_audioVendor_GetNodeGain(0x1, direction, &getGainPerc);
     if(res == LE_OK)
         LE_INFO("Successfully got the gain of audio device %f", getGainPerc);
    Copy to clipboard

Last Published: Jun 09, 2026

[Previous Topic
Audio Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_taf_audio.md) [Next Topic
CAN Service](https://docs.qualcomm.com/bundle/publicresource/80-41102-2/topics/page_c_tafcan.md)