Skip to content

feat: Text-To-Speech 구현 #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: Text-To-Speech 구현 #54

wants to merge 2 commits into from

Conversation

minjun011026
Copy link
Contributor

⭐️ 변경된 내용

  • 받아온 메시지를 음성파일로 받아 실행하는 기능을 구현했습니다.
  • LearnUiState에서 isConvert가 필요없는 것 같아서 제거했습니다.

📌 이 부분은 꼭 봐주세요! (Optional)

  • tts 기능 구현에만 초점을 맞췄습니다.

🏞️ 스크린샷 (Optional)

KakaoTalk_20250509_024448460.mp4

@minjun011026 minjun011026 requested review from HI-JIN2 and Copilot May 8, 2025 17:49
@minjun011026 minjun011026 self-assigned this May 8, 2025
Copy link

@Copilot 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 implements Text-To-Speech functionality by integrating a new audio download service, streamlining UI state management by removing the unused conversion state, and updating the necessary dependency and permission configurations.

  • Implements TTS playback and download logic in the LearningViewModel.
  • Removes the redundant LearningUiState.isConverting state.
  • Adjusts UI components in LearningScreen to support the new TTS flow.
  • Adds new repository, use case, and DI configurations for TTS with corresponding updates in the manifest and build files.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
presentation/learning/src/main/java/com/saegil/learning/learning/LearningViewModel.kt Adds TTS playback functionality, integrates DownloadAudioUseCase, and updates state management.
presentation/learning/src/main/java/com/saegil/learning/learning/LearningUiState.kt Removes the unused isConverting state.
presentation/learning/src/main/java/com/saegil/learning/learning/LearningScreen.kt Updates UI state handling and modifies recording logic to focus on TTS functionality.
domain/src/main/java/com/saegil/domain/usecase/DownloadAudioUseCase.kt Introduces a use case for downloading audio from the TTS service.
domain/src/main/java/com/saegil/domain/repository/TextToSpeechRepository.kt Defines the repository interface for TTS functionality.
data/src/main/java/com/saegil/data/repository/TextToSpeechRepositoryImpl.kt Implements the TTS repository using the TextToSpeechService.
data/src/main/java/com/saegil/data/remote/TextToSpeechServiceImpl.kt Implements the TTS service using the Ktor client to retrieve audio.
data/src/main/java/com/saegil/data/remote/HttpRoutes.kt Adds the TTS endpoint route.
data/src/main/java/com/saegil/data/di/NetworkModule.kt Provides dependency injection bindings for the TTS service.
data/src/main/java/com/saegil/data/di/DataModule.kt Provides DI configuration for the TTS repository.
app/src/main/AndroidManifest.xml Adds the RECORD_AUDIO permission required for audio recording.
app/build.gradle.kts Increments the versionCode reflecting new changes.

@@ -181,11 +180,8 @@ fun LearningScreen(
when (state) {
is LearningUiState.Success, is LearningUiState.Idle -> {
RecordButton(
isRecording = state == LearningUiState.isRecording,
isRecording = false,
Copy link
Preview

Copilot AI May 8, 2025

Choose a reason for hiding this comment

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

The RecordButton onClick logic has been removed, which disables the functionality to start/stop recording. If this change is intentional to focus solely on TTS, please add a clarifying comment to explain the expected behavior.

Suggested change
isRecording = false,
isRecording = false,
// The onClick logic ensures that recording starts if the necessary permissions are granted.
// If the focus of the application has shifted to TTS and recording is no longer required,
// this logic can be removed, but a clarifying comment should be added to explain the change.

Copilot uses AI. Check for mistakes.

@minjun011026 minjun011026 marked this pull request as ready for review May 8, 2025 17:52
Copy link
Contributor

@HI-JIN2 HI-JIN2 left a comment

Choose a reason for hiding this comment

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

🙇‍♀️수고 많으셨습니다!

  1. RECORD_AUDIO가 재생할때 필요한 권한인가요??

  2. convertAndUpload안에서 downloadAudio를 호출하는건 좀 맥락상에서 자연스럽지 않은 것 같아요. convertAndUpload 메소드 이름만 봐서는 진짜 변환하고 업로드만 하는 것 같아서.. 그래서 제가 드리는 제안은

다른 함수에서 convertAndUpload도 호출하고 downloadAudio도 호출하는게 어떨까유???
아니면 convertAndUpload 네이밍을 바꾸면 좋을 것 같아요. 사실 convert는 안드에서 안하니까.. 빼도 될 것 같구.. UploadAndTTS ? UploadAndGetFile? UploadAndGetMp3? 등등...

  1. 그리구 conflict 있구만유

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.

2 participants