Skip to content
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

Transcription events CLT-343 #406

Merged
merged 15 commits into from
Aug 8, 2024
Merged

Transcription events CLT-343 #406

merged 15 commits into from
Aug 8, 2024

Conversation

hiroshihorie
Copy link
Member

@hiroshihorie hiroshihorie commented Jun 18, 2024

  • Events for RoomDelegate
  • Events for ParticipantDelegate
  • State management

@hiroshihorie hiroshihorie marked this pull request as ready for review July 1, 2024 15:25
guard let participant = _state.read({
$0.remoteParticipants.values.first { $0.identity == Participant.Identity(from: packet.transcribedParticipantIdentity) }
}) else {
log("[Transcription] Could not find participant: \(packet.transcribedParticipantIdentity)", .warning)
Copy link
Contributor

Choose a reason for hiding this comment

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

@hiroshihorie you'll need to include support for transcription events coming down on the LocalParticipant as well, to record the results of STT in the agent

Copy link
Contributor

Choose a reason for hiding this comment

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

I did a quick spike and it works to just change the delegate methods to receive generic Participant and TrackPublication instead of the Remote variants, change these lines up here to the following

        let participant: Participant?
        
        let identity = Participant.Identity(from: packet.transcribedParticipantIdentity)
        if localParticipant.identity == identity {
            participant = localParticipant
        } else {
            participant = _state.read({ $0.remoteParticipants.values.first { $0.identity == identity } })
        }
            
        guard let participant else {
            log("[Transcription] Could not find participant: \(packet.transcribedParticipantIdentity)", .warning)
            return
        }

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you ! will update.

@hiroshihorie hiroshihorie changed the title Transcription events Transcription events CLT-343 Aug 6, 2024
@hiroshihorie hiroshihorie requested a review from bcherry August 6, 2024 06:16
@hiroshihorie
Copy link
Member Author

If looks good will merge first, then think about if any state helpers are necessary.

Copy link
Contributor

@bcherry bcherry left a comment

Choose a reason for hiding this comment

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

looks good - go ahead and file a new issue for any state management follow-ons

@hiroshihorie hiroshihorie merged commit eaf1e24 into main Aug 8, 2024
11 checks passed
@hiroshihorie hiroshihorie deleted the hiroshi/transcription branch August 8, 2024 15:07
override public var hash: Int {
var hasher = Hasher()
hasher.combine(id)
return hasher.finalize()
Copy link
Contributor

Choose a reason for hiding this comment

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

@hiroshihorie @lukasIO do you two think it's right to identify and hash these based on ID alone? It doesn't guarantee true equality, because a newer version could be received later that should be used instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

what's the intended purpose of the hash?

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.

3 participants