This commit is contained in:
2026-03-08 21:29:10 +08:00
parent 9fb2e2e694
commit c1ace5f53e
34 changed files with 870 additions and 1930 deletions

View File

@@ -17,24 +17,15 @@ NS_ASSUME_NONNULL_BEGIN
- (void)voiceToTextManagerDidBeginRecording:(KBVoiceToTextManager *)manager;
- (void)voiceToTextManagerDidEndRecording:(KBVoiceToTextManager *)manager;
- (void)voiceToTextManagerDidCancelRecording:(KBVoiceToTextManager *)manager;
- (void)voiceToTextManager:(KBVoiceToTextManager *)manager
didUpdateInterimText:(NSString *)text;
- (void)voiceToTextManager:(KBVoiceToTextManager *)manager
didReceiveFinalText:(NSString *)text;
- (void)voiceToTextManager:(KBVoiceToTextManager *)manager
didFailWithError:(NSError *)error;
@end
/// Voice-to-text manager (binds KBVoiceInputBar and uses Deepgram).
/// 语音输入事件管理器,仅负责桥接 KBVoiceInputBar 的录音事件。
@interface KBVoiceToTextManager : NSObject
@property(nonatomic, weak) id<KBVoiceToTextManagerDelegate> delegate;
@property(nonatomic, weak, readonly) KBVoiceInputBar *inputBar;
@property(nonatomic, assign) BOOL deepgramEnabled;
- (instancetype)initWithInputBar:(KBVoiceInputBar *)inputBar;
- (void)prepareConnection;
- (void)disconnect;
@end