@startuml !theme mono title STT Service - 음성녹음시작 내부 시퀀스 participant "RecordingController" as Controller participant "RecordingService" as Service participant "RecordingRepository" as Repository participant "AzureSpeechClient" as AzureClient database "STT DB" as DB database "Azure Blob Storage<>" as BlobStorage queue "Azure Event Hubs<>" as EventHub == MeetingStarted 이벤트 수신 == EventHub -> Controller: MeetingStarted 이벤트 수신\n(meetingId, sessionId) activate Controller Controller -> Service: prepareRecording(meetingId, sessionId) activate Service Service -> Service: 녹음 세션 검증 note right - 중복 녹음 방지 체크 - meetingId 유효성 검증 end note Service -> Repository: createRecording(meetingId, sessionId) activate Repository Repository -> DB: INSERT INTO recordings\n(recording_id, meeting_id, session_id,\nstatus='READY', created_at) activate DB DB --> Repository: recordingId 반환 deactivate DB Repository --> Service: RecordingEntity 반환 deactivate Repository == Azure Speech Service 초기화 == Service -> AzureClient: initializeRecognizer(recordingId, sessionId) activate AzureClient AzureClient -> AzureClient: 음성 인식기 설정 note right - 언어: ko-KR - 샘플레이트: 16kHz - 화자 식별 활성화 - 실시간 스트리밍 모드 end note AzureClient -> BlobStorage: 녹음 파일 저장 경로 생성\n(path: recordings/{meetingId}/{sessionId}.wav) activate BlobStorage BlobStorage --> AzureClient: 저장 경로 URL 반환 deactivate BlobStorage AzureClient --> Service: RecognizerConfig 반환 deactivate AzureClient == 녹음 상태 업데이트 == Service -> Repository: updateRecordingStatus(recordingId, "RECORDING") activate Repository Repository -> DB: UPDATE recordings\nSET status='RECORDING',\nstarted_at=NOW(),\nstorage_path='{blobUrl}'\nWHERE recording_id='{recordingId}' activate DB DB --> Repository: 업데이트 완료 deactivate DB Repository --> Service: 업데이트 완료 deactivate Repository Service --> Controller: RecordingResponse(recordingId, status, storagePath) deactivate Service Controller --> EventHub: RecordingStarted 이벤트 발행\n(recordingId, meetingId, status) deactivate Controller note over Controller, EventHub 처리 시간: - DB 녹음 생성: ~100ms - Azure 인식기 초기화: ~500ms - Blob 경로 생성: ~200ms - 총 처리 시간: ~800ms end note @enduml