fix: address code review feedback (PR #13, #15)#17
Conversation
- Add thread-safety doc comments to AudioEngineManager callbacks (onSamples/onAudioLevel must be set before start()) - Remove unused termNormalizer field from ASREngineFactory.Result - Remove dead destDir assignment in ModelDownloader delegate method Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Review Summary
Clean, well-scoped PR. All three changes verified:
-
ASREngineFactory.Result —
termNormalizerremoval is safe. The only caller (RecordingManager.swift:208) accessesresult.engineonly; the normalizer is set directly on the pipeline at factory line 58. -
AudioEngineManager — Doc comments accurately describe the threading contract. Both
onSamplesandonAudioLevelare indeed set beforestart()in current usage. Note: there's no runtime enforcement (no locks/actors) — the contract is convention-based, which the docs now make explicit. -
ModelDownloader — Dead
destDirassignment correctly removed (both ternary branches were identical). Comment about unused second parameter is accurate — the handler closure (SherpaOnnxManager.swift:134) capturesmodelsDirectorydirectly and ignores the parameter with_.
No issues found.
Version in project.pbxproj was stuck at 1.3.0 since the v1.3.0 release. Updates both Debug and Release configurations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
onSamplesandonAudioLevelcallbacks, clarifying they must be set beforestart()and not mutated while the engine is runningtermNormalizerfield fromResultstruct (the pipeline sets it directly, caller never reads it)destDirassignment and clarify why the second parameter ofextractionHandleris unusedTest plan
xcodebuild -scheme Typeless -configuration Debug)🤖 Generated with Claude Code