Discussions

Ask a Question
Back to All

Changing voice doesn't seem to work with the @heygen/streaming-avatar library

According to the source code I just gotta set the voice ID:

export interface StartAvatarRequest {
  quality?: AvatarQuality;
  avatarName: string;
  voice?: { voiceId?: string };
  knowledgeId?: string;
}

E.g.:

const res = await avatar.current.createStartAvatar({
    quality: AvatarQuality.Low,
    avatarName: avatarId,
    knowledgeId: knowledgeId,
    voice: { voiceId: "0009aabefe3a4553bc581d837b6268cb" },
});

(Voice Name: Walter Sinclair).


I queried the voices from both the v1 and v2 voices endpoint (https://docs.heygen.com/reference/list-voices-v2), and tried 8 male voices.
None of them changed the default female voice to a male voice.

I also tried adding elevenlabs to my HeyGen account and tried an 11Labs voice, also without success.

I'm not using a paid account but the free trial token, could this be the issue?
It's the demo repo that I'm adapting, so I got most of the code from there in case that helps.

How to change the voice?