TencentNavKit
TNKAudioPlayerProtocol.h
Go to the documentation of this file.
1//
2// TNKAudioPlayerProtocol.h
3// TencentNavKit
4//
5// Created by mol on 2022/11/18.
6// Copyright © 2022 Tencent. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import <TencentNavKit/TNKNavTTS.h>
11
12NS_ASSUME_NONNULL_BEGIN
13
14@class TNKAudioParam;
16
20@protocol TNKAudioPlayerDelegate <NSObject>
21
26- (void)invokeAudioPlayerWillStartPlaying:(id<TNKAudioPlayerProtocol>)player;
27
32- (void)audioPlayerDidFinishPlaying:(id<TNKAudioPlayerProtocol>)player;
33
40- (void)audioPlayerDidFinishPlaying:(id<TNKAudioPlayerProtocol>)player text:(NSString *)text successfully:(BOOL)flag;
41
42@end
43
47@protocol TNKAudioPlayerProtocol <NSObject>
48
52@property (nonatomic, weak) id <TNKAudioPlayerDelegate> delegate;
53
57@property (nonatomic, readonly) BOOL isPlaying;
58
63@property (nonatomic, assign) float volume;
64
69- (void)playWithAudioParam:(TNKAudioParam *)audioParam;
70
75- (void)playWithNaviTTS:(TNKNavTTS *)naviTTS;
76
80- (void)stop;
81
82@end
83
85@interface TNKAudioParam : NSObject
86
90@property (nonatomic, copy) NSString *text;
91
95@property (nonatomic, assign) int playOption;
96
97
98@end
99
100NS_ASSUME_NONNULL_END
播报信息.
Definition: TNKAudioPlayerProtocol.h:86
int playOption
播报策略。0为打断当前正在播报的内容,并播报改内容;1为排队,当前播报完毕后播报该内容
Definition: TNKAudioPlayerProtocol.h:95
NSString * text
播报内容
Definition: TNKAudioPlayerProtocol.h:90
TTS播报内容
Definition: TNKNavTTS.h:33
内置语音播报器事件回调.
Definition: TNKAudioPlayerProtocol.h:20
语音播报器协议
Definition: TNKAudioPlayerProtocol.h:47
BOOL isPlaying
语音播报器是否在播放状态.
Definition: TNKAudioPlayerProtocol.h:57
id< TNKAudioPlayerDelegate > delegate
TNKAudioPlayer的回调. 用于接收播报状态等事件.
Definition: TNKAudioPlayerProtocol.h:52
void stop()
停止当前播报内容.
float volume
控制音量,设置范围[0, 1]T
Definition: TNKAudioPlayerProtocol.h:63