Repository navigation
Speak "Sound ahead" instead of "Sound from your ahead" - #3
Merged
Merged
Conversation
Unlabeled announcements interpolated the bare direction word into "Sound from your %@", so a centred source was spoken as "Sound from your ahead". Add DirectionLabel.spokenSentence with one localized sentence per bucket (English and Spanish), use it in SpeechAnnouncer and the Announce Direction intent, and cover direction 0 without a label in tests. Fixes #2
The macos-15 runner image now defaults to Xcode 16.4, which has no iPhone 17 Pro simulator, so the iOS test job failed before building. Select the newest non-beta Xcode on the runner and resolve the simulator by UDID, preferring iPhone 17 Pro and falling back to any available iPhone.
The repeat filter compared against lastDirection = 0 and lastLabel = nil before anything had been announced, so a first sound at direction 0 with no label matched the empty state and was silently dropped. Track "no announcement yet" as nil so the first sound always speaks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unlabeled speech announcements built
"Sound from your \(word)", so a centred source was spoken as "Sound from your ahead". Each direction bucket now has its own full localized sentence. The new direction-0 test also found that a first sound that is centred and unlabeled was never announced at all; that is fixed too.Changes
Shared/DirectionLabel.swift: newspokenSentence(direction:)returning "Sound from your far left", "Sound from your left", "Sound ahead", "Sound from your right", "Sound from your far right" (same bucket boundaries asspokenPhrase).SoundCompass/Services/SpeechAnnouncer.swift:spokenSentence. The labelled form ("car horn ahead") is unchanged.lastDirection = 0/lastLabel = nilbefore anything had been announced, so a first sound at direction 0 with no label matched that empty state and was dropped.lastDirectionis now optional (nil = nothing announced yet) so the first sound always speaks.SoundCompass/Intents/SoundCompassIntents.swift: the Announce Direction intent had the same "Sound from your ahead." bug; it now usesspokenSentencetoo (and is localized as a side effect).Localizable.strings(en, es): replaced the"Sound from your %@"key with the five sentence keys. Spanish output is the same as before ("Sonido delante", "Sonido a la izquierda", ...).SpeechAnnouncerTests.testCenteredPhraseWithoutLabelIsGrammatical(direction 0, label nil, expects "Sound ahead"; failed in CI before the announcer fix),testFarRightPhraseWithoutLabel(empty label), andDirectionLabelTests.testSpokenSentenceBuckets..github/workflows/soundcompass.yml: the iOS job failed before building because the macos-15 runner image now defaults to Xcode 16.4, which has no iPhone 17 Pro simulator. The job now selects the newest non-beta Xcode on the runner and resolves the simulator by UDID, preferring iPhone 17 Pro and falling back to any available iPhone.Testing
SoundCompass-iOS, 123 tests) and the watchOS build.Fixes #2