Skip to content

[Feat] SpeechService 개선 #39

Merged
wlgusqkr merged 2 commits intodevfrom
feat/update-speechService
Feb 5, 2026
Merged

[Feat] SpeechService 개선 #39
wlgusqkr merged 2 commits intodevfrom
feat/update-speechService

Conversation

@wlgusqkr
Copy link
Contributor

@wlgusqkr wlgusqkr commented Feb 5, 2026

🚨 관련 이슈

✨ 변경사항

  • 🐞 BugFix Something isn't working
  • 🌏 Deploy Deploy
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (storybook, jest, etc.)

✏️ 작업 내용

  • 작업 내용

😅 미완성 작업

  • Task1

📢 논의 사항 및 참고 사항

@gemini-code-assist
Copy link

Summary of Changes

Hello @wlgusqkr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 음성 재생에 일시정지 및 다시 시작 기능을 도입하여 SpeechService를 크게 개선합니다. 이 개선 사항은 사용자에게 오디오 콘텐츠에 대한 더 세밀한 제어 기능을 제공합니다. 변경 사항은 UI 상호작용을 위한 HomeView와 상태 관리를 위한 MainViewModel에 걸쳐 통합되어 원활한 사용자 경험을 보장합니다. 또한, 접근성 레이블이 새로운 상태를 반영하도록 업데이트되었으며, 재생할 콘텐츠가 없을 때 메시지가 제공됩니다.

Highlights

  • 음성 서비스 개선: 음성 재생에 일시정지 및 다시 시작 기능을 추가하여 사용자가 오디오 콘텐츠를 더 세밀하게 제어할 수 있도록 SpeechService를 개선했습니다.
  • UI 통합: HomeView의 재생 버튼이 이제 음성 서비스의 새로운 일시정지/재생 상태를 반영하고 제어합니다.
  • ViewModel 업데이트: MainViewModel에 'isPaused' 상태를 관리하고 'pausePlayback' 및 'resumePlayback' 메서드를 노출하는 로직이 추가되었습니다.
  • 접근성 향상: 재생 버튼의 접근성 레이블이 현재 음성 상태(재생 중, 일시정지, 정지)에 따라 동적으로 변경되도록 업데이트되었습니다.
  • 빈 피드 처리: 구독한 페이지가 없거나 새로운 글이 없을 때 사용자에게 안내하는 음성 메시지가 추가되었습니다.
Changelog
  • today-s-sound/App/TodaySSoundApp.swift
    • guard let 구문의 가독성을 높이기 위한 사소한 서식 조정이 있었습니다.
  • today-s-sound/Presentation/Features/Main/Home/HomeView.swift
    • 재생 버튼의 동작이 SpeechService의 상태에 따라 일시정지, 다시 시작, 재생 시작을 지원하도록 수정되었습니다.
    • 홈 피드 항목이 없을 때 음성 메시지를 추가했습니다.
    • 재생 버튼의 접근성 레이블이 현재 상태에 따라 '일시정지', '이어서 재생', '재생 시작'으로 동적으로 변경되도록 업데이트되었습니다.
  • today-s-sound/Presentation/Features/Main/MainViewModel.swift
    • 재생 일시정지 상태를 추적하기 위한 '@published var isPaused: Bool' 속성이 추가되었습니다.
    • SpeechService를 제어하기 위한 'pausePlayback()' 및 'resumePlayback()' 메서드가 구현되었습니다.
    • 'stopPlayback()'이 호출될 때 'isPaused'가 'false'로 재설정되도록 보장합니다.
  • today-s-sound/Services/SpeechService.swift
    • 내부 일시정지 상태를 추적하기 위한 '@published var isPaused: Bool' 속성이 추가되었습니다.
    • 'speak' 메서드가 새로운 음성을 시작하기 전에 현재 재생 중이거나 일시정지된 상태를 중지하도록 수정되었습니다.
    • AVSpeechSynthesizer를 일시정지하고 'isSpeaking' 및 'isPaused' 상태를 업데이트하는 'pause()' 메서드가 구현되었습니다.
    • 음성 재생을 계속하고 'isSpeaking' 및 'isPaused' 상태를 업데이트하는 'resume()' 메서드가 구현되었습니다.
    • 'stop()' 메서드가 'isSpeaking'과 'isPaused'를 모두 재설정하고, 합성기가 재생 중이거나 일시정지된 경우 중지하도록 업데이트되었습니다.
Activity
  • 이 PR에 대한 특정 활동(댓글, 리뷰 등)은 제공되지 않았습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@wlgusqkr wlgusqkr merged commit 3b9da90 into dev Feb 5, 2026
1 check failed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 SpeechService에 일시정지 및 이어하기 기능을 추가하여 사용자 경험을 개선하는 좋은 변경입니다. 코드 전반적으로 기능 구현은 잘 되었으나, MainViewModelSpeechServiceisPaused 상태가 중복으로 관리되고 있어 잠재적인 상태 불일치 문제를 발견했습니다. 리뷰 코멘트에서는 이 문제를 해결하기 위해 SpeechService를 단일 진실 공급원(Single Source of Truth)으로 사용하는 리팩토링을 제안했습니다.

speechService.stop()
// 재생 중 → 일시정지
viewModel.pausePlayback()
} else if viewModel.isPaused {

Choose a reason for hiding this comment

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

medium

MainViewModel의 중복된 isPaused 상태 대신, SpeechService의 상태를 직접 사용하는 것이 상태 관리 측면에서 더 안전하고 명확합니다.

Suggested change
} else if viewModel.isPaused {
} else if speechService.isPaused {

}
)
.accessibilityLabel(speechService.isSpeaking ? "재생 중단" : "재생 시작")
.accessibilityLabel(speechService.isSpeaking ? "일시정지" : viewModel.isPaused ? "이어서 재생" : "재생 시작")

Choose a reason for hiding this comment

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

medium

MainViewModel의 중복된 isPaused 상태 대신, SpeechService의 상태를 직접 사용하는 것이 상태 관리 측면에서 더 안전하고 명확합니다.

Suggested change
.accessibilityLabel(speechService.isSpeaking ? "일시정지" : viewModel.isPaused ? "이어서 재생" : "재생 시작")
.accessibilityLabel(speechService.isSpeaking ? "일시정지" : speechService.isPaused ? "이어서 재생" : "재생 시작")

@Published var recentAlerts: [Alert] = []
@Published var homeFeedItems: [HomeFeedItemResponse] = []
@Published var isLoading: Bool = false
@Published var isPaused: Bool = false

Choose a reason for hiding this comment

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

medium

isPaused 상태가 SpeechServiceMainViewModel에 중복으로 정의되어 있습니다. 이로 인해 두 상태가 동기화되지 않을 경우 예기치 않은 동작이 발생할 수 있습니다.

SpeechService가 음성 재생 상태에 대한 단일 진실 공급원(Single Source of Truth) 역할을 하도록 구조를 개선하는 것이 좋습니다.

제안:

  1. MainViewModel에서 isPaused 속성을 제거합니다.
  2. pausePlayback, resumePlayback, stopPlayback 메서드에서 isPaused 상태를 직접 변경하는 코드를 제거합니다.
  3. HomeView에서는 viewModel.isPaused 대신 speechService.isPaused를 직접 사용하여 UI 상태를 결정합니다. (HomeView는 이미 speechService를 관찰하고 있으므로 쉽게 변경할 수 있습니다.)

이렇게 하면 상태 관리가 단순해지고 잠재적인 버그를 예방할 수 있습니다.

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.

1 participant