Skip to content

Prefer natural macOS say voices and skip novelty fallbacks#33

Merged
harumiWeb merged 2 commits intomainfrom
copilot/fix-say-command-voice-selection
Apr 7, 2026
Merged

Prefer natural macOS say voices and skip novelty fallbacks#33
harumiWeb merged 2 commits intomainfrom
copilot/fix-say-command-voice-selection

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

macOS voice auto-selection currently picks the first en_US voice returned by say -v ?, which can select novelty/system-effect voices and produce unnatural playback. This change makes voice selection deterministic for learning use by preferring a small set of natural English voices and excluding novelty voices from fallback.

  • Voice selection

    • Parse the full say -v ? voice list before choosing a voice
    • Prefer a curated set of natural English voices when available:
      • Samantha, Alex, Daniel, Karen, Moira
    • Match on English locales broadly (en_*, en-*) instead of relying on a single exact locale
  • Fallback behavior

    • Exclude novelty/effect voices from automatic fallback selection
    • Return no explicit voice when only novelty English voices are available, allowing say to use its default behavior instead of forcing a poor-quality choice
  • Regression coverage

    • Add Darwin-specific tests for:
      • preferred-voice selection even when novelty voices appear earlier
      • English fallback that skips novelty voices
      • empty selection when the only English options are novelty voices
for _, preferred := range darwinPreferredVoiceNames {
	for _, voice := range voices {
		if voice.name == preferred && isDarwinEnglishLocale(voice.locale) {
			return voice.name
		}
	}
}

for _, voice := range voices {
	if isDarwinEnglishLocale(voice.locale) && !isDarwinNoveltyVoice(voice.name) {
		return voice.name
	}
}

return ""

Open with Devin

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
4 tasks
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 7, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 22 complexity · 6 duplication

Metric Results
Complexity 22
Duplication 6

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Agent-Logs-Url: https://github.com/harumiWeb/eitango/sessions/94f61f18-4d5a-45ea-bbad-dfea95f0fb58

Co-authored-by: harumiWeb <164025931+harumiWeb@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix voice selection logic for say command in macOS Prefer natural macOS say voices and skip novelty fallbacks Apr 7, 2026
Copilot AI requested a review from harumiWeb April 7, 2026 07:55
@harumiWeb harumiWeb requested a review from Copilot April 7, 2026 08:01
@harumiWeb harumiWeb marked this pull request as ready for review April 7, 2026 08:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves macOS (say) voice auto-selection to avoid novelty/effect voices and produce more natural, deterministic speech for learning use.

Changes:

  • Prefer a curated list of natural English voices (e.g., Samantha/Alex/Daniel/…) after parsing the full say -v ? output.
  • Broaden English locale matching to en* locales and update fallback to skip novelty voices (or return empty to let say decide).
  • Add Darwin-specific regression tests for preferred selection, novelty-skipping fallback, and “only novelty voices” behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/audio/factory_darwin.go Implements deterministic preferred-voice selection and novelty-skipping English fallback for macOS say.
internal/audio/factory_darwin_test.go Adds tests covering preferred voice choice vs earlier novelty voices, fallback skipping novelty voices, and empty selection when only novelty voices exist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@harumiWeb harumiWeb merged commit 8694abf into main Apr 7, 2026
12 checks passed
@harumiWeb harumiWeb deleted the copilot/fix-say-command-voice-selection branch April 7, 2026 08:27
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.

Macの音声再生がやばい

3 participants