Skip to content

feat: add getVoicesByGender() and fix gender mappings in Google and ElevenLabs#45

Merged
OwenMcGirr merged 1 commit into
mainfrom
feat/44-get-voices-by-gender
Apr 12, 2026
Merged

feat: add getVoicesByGender() and fix gender mappings in Google and ElevenLabs#45
OwenMcGirr merged 1 commit into
mainfrom
feat/44-get-voices-by-gender

Conversation

@OwenMcGirr
Copy link
Copy Markdown
Collaborator

Closes #44

Summary

  • Add getVoicesByGender(gender: "Male" | "Female" | "Unknown"): Promise<UnifiedVoice[]> to AbstractTTSClient, reusing the existing filterByGender() utility from voice-utils.ts
  • Fix Google engine: ssmlGender was lowercased ("male"/"female") which violated the UnifiedVoice.gender type — now maps MALEMale, FEMALEFemale, everything else→Unknown
  • Fix ElevenLabs bulk voice list: _mapVoicesToUnified was hardcoded to gender: undefined; now maps labels.gender when present ("male""Male", "female""Female"), leaving undefined when absent (field is undocumented and not guaranteed by the API)

Test plan

  • npx jest __tests__/abstract-tts-gender.test.ts — 4 tests covering Female/Male/Unknown/empty results
  • npx jest __tests__/google-gender.test.ts — 5 tests covering MALE/FEMALE/NEUTRAL/UNSPECIFIED/missing
  • npx jest __tests__/elevenlabs-gender.test.ts — 4 tests covering female/male/absent labels/no labels
  • npm run build — clean build, no TypeScript errors

…nLabs (#44)

- Add AbstractTTSClient.getVoicesByGender() reusing existing filterByGender() utility
- Fix Google engine: map ssmlGender MALE/FEMALE/NEUTRAL → Male/Female/Unknown (was lowercase)
- Fix ElevenLabs bulk voice list: map labels.gender when present; leave undefined otherwise
@OwenMcGirr OwenMcGirr merged commit 251eee4 into main Apr 12, 2026
3 of 6 checks passed
@OwenMcGirr OwenMcGirr deleted the feat/44-get-voices-by-gender branch April 12, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add getVoicesByGender() and fix gender mappings in Google and ElevenLabs

1 participant