WhisperLive iOS 클라이언트 전체 포팅 #3
Open
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.
개요
Python의 WhisperLive 클라이언트를 Swift로 완전히 포팅하는 작업을 완료했습니다. 초기 PR에서 오디오 데이터 변환 문제를 해결한 후, 추가적인 문제점들을 발견하고 해결하여 완전한 기능을 구현했습니다.
초기 PR 이후 발견된 추가 문제점
초기화 과정 누락
WebSocket 연결 후 on_open 이벤트에서 필요한 초기화 메시지가 제대로 전송되지 않음
서버가 클라이언트 식별 및 설정을 인식하지 못하는 문제 발생
오디오 리샘플링 미구현
Python 코드의 utils.resample() 함수에 해당하는 기능이 Swift에서 구현되지 않아 파일 재생 시 문제 발생
16kHz 샘플레이트로의 변환이 필요한 오디오 파일 처리 불가
WebSocket URL 형식 오류
WebSocket URL 생성 시 포트 번호가 포함되지 않는 문제
"wss://host" 형식이 아닌 "wss://host:port" 형식이 필요함
메시지 처리 로직 개선 필요
서버에서 받은 응답에 대한 처리가 불완전하여 트랜스크립션 결과가 제대로 표시되지 않음
상태 메시지, 언어 감지, 세그먼트 처리 등의 로직 미비
Utils 클래스 구현 부재
Python의 utils.py에 있는 기능들이 Swift에서 구현되지 않아 SRT 파일 생성 등의 기능 사용 불가
수정 내용
WebSocket 초기화 과정 개선
오디오 리샘플링 기능 구현:
WebSocket URL 형식 수정
메시지 처리 로직 개선:
Utils 클래스 전체 구현:
AVAudioEngine 설정 최적화:
종료 처리 개선: