transport.audioFormat.an unknown value was passed ...
# support
j
I am attempting to connect a Vapi Squad to a Twilio number on my own server but I am getting this error whenever I try to create a call: > transport.audioFormat.an unknown value was passed to the validate function My request looks like this:
Copy code
const requestBody = JSON.stringify({
      ...(squadId ? { squadId: squadId } : { assistant: { assistantId } }),
      transport: {
        audioFormat: {
          format: "pcm_s16le",
          container: "raw",
          sampleRate: 8000,
        },
      },
    });

    // Initialize a call with Vapi using WebSocket transport
    const response = await fetch("https://api.vapi.ai/call", {
      method: "POST",
      headers: {
        authorization: `Bearer ${apiKey}`,
        "content-type": "application/json",
      },
      body: requestBody,
    });
I have been referencing these docs: https://docs.vapi.ai/calls/websocket-transport#audio-format-configuration
v
Try modifying your audio format configuration to match Vapi's documented format for custom transcribers:
Copy code
javascript
transport: {
  audioFormat: {
    encoding: "linear16",
    container: "raw",
    sampleRate: 16000,
    channels: 2
  },
}
According to Vapi's documentation, this is the expected format when streaming audio. Source: - [Vapi Documentation Custom Transcriber](https://docs.vapi.ai/documentation/advanced-concepts/customization/custom-transcriber)
j
I was able to get past this issue by removing the
audioFormat
field completely:
Copy code
transport: {
        provider: "vapi.websocket", // "daily"
      },
c
nice work! if you have any more questions regarding this issue or others, let us know
2 Views