Discussions
Disorted voice generation in Elevenlabs Agent plugin
Hi LiveAvatar Support Team,
I’m integrating LiveAvatar using the iveavatar-elevenlabs agent plugin. The issue I’m seeing is that the voice output in the LiveAvatar session sounds unnatural / produces funny distorted sounds.
What’s confusing is:
When I listen to the conversation directly from ElevenLabs, the agent audio sounds good but not the user audio.
Here’s the session token code I’m using:
export async function createLiveAvatarSession(): Promise<{ accessToken: string; externalSessionId: string }> {
const response = await axios.post<{
data: { session_token: string; session_id: string };
code: number;
message: string;
}>(
'https://api.liveavatar.com/v1/sessions/token',
{
mode: 'LITE',
elevenlabs_agent_config: {
secret_id: process.env.NEXT_PUBLIC_ELEVENLABS_SECRET_ID,
agent_id: process.env.NEXT_PUBLIC_CONVO_AGENT_ID,
},
avatar_id: process.env.NEXT_PUBLIC_LIVEAVATAR_AVATAR_ID,
},
{
headers: {
'X-API-KEY': process.env.NEXT_PUBLIC_LIVEAVATAR_API_KEY,
},
},
);
const data = response.data;
if (!data?.data?.session_token) {
throw new Error('Invalid LiveAvatar session response: missing accessToken');
}
return { accessToken: data.data.session_token, externalSessionId: data.data.session_id };
}
Could you please help me understand:
Why the voice becomes distorted in LiveAvatar while it sounds normal in ElevenLabs?
Do you need anything from us (session_id, timestamps, logs, network trace, browser/device details) to diagnose this?
If you tell me what debug info you prefer, I can share it right away.