82 lines
1.7 KiB
Objective-C
82 lines
1.7 KiB
Objective-C
//
|
||
// IFlySpeechSynthesizerDelegate.h
|
||
// MSC
|
||
//
|
||
// Created by ypzhao on 13-3-20.
|
||
// Copyright (c) 2013年 iflytek. All rights reserved.
|
||
//
|
||
|
||
#import <Foundation/Foundation.h>
|
||
#import "IFlySpeechEvent.h"
|
||
|
||
@class IFlySpeechError;
|
||
|
||
/*!
|
||
* 语音合成回调
|
||
*/
|
||
@protocol IFlySpeechSynthesizerDelegate <NSObject>
|
||
|
||
@required
|
||
|
||
/*!
|
||
* 结束回调<br>
|
||
* 当整个合成结束之后会回调此函数
|
||
*
|
||
* @param error 错误码
|
||
*/
|
||
- (void) onCompleted:(IFlySpeechError*) error;
|
||
|
||
@optional
|
||
|
||
/*!
|
||
* 开始合成回调
|
||
*/
|
||
- (void) onSpeakBegin;
|
||
|
||
/*!
|
||
* 缓冲进度回调
|
||
*
|
||
* @param progress 缓冲进度,0-100
|
||
* @param msg 附件信息,此版本为nil
|
||
*/
|
||
- (void) onBufferProgress:(int) progress message:(NSString *)msg;
|
||
|
||
/*!
|
||
* 播放进度回调
|
||
*
|
||
* @param progress 当前播放进度,0-100
|
||
* @param beginPos 当前播放文本的起始位置,0-100
|
||
* @param endPos 当前播放文本的结束位置,0-100
|
||
*/
|
||
- (void) onSpeakProgress:(int) progress beginPos:(int)beginPos endPos:(int)endPos;
|
||
|
||
/*!
|
||
* 暂停播放回调
|
||
*/
|
||
- (void) onSpeakPaused;
|
||
|
||
/*!
|
||
* 恢复播放回调<br>
|
||
* 注意:此回调方法SDK内部不执行,播放恢复全部在onSpeakBegin中执行
|
||
*/
|
||
- (void) onSpeakResumed;
|
||
|
||
/*!
|
||
* 正在取消回调<br>
|
||
* 注意:此回调方法SDK内部不执行
|
||
*/
|
||
- (void) onSpeakCancel;
|
||
|
||
/*!
|
||
* 扩展事件回调<br>
|
||
* 根据事件类型返回额外的数据
|
||
*
|
||
* @param eventType 事件类型,具体参见IFlySpeechEventType枚举。目前只支持EVENT_TTS_BUFFER也就是实时返回合成音频。
|
||
* @param arg0 arg0
|
||
* @param arg1 arg1
|
||
* @param eventData 事件数据
|
||
*/
|
||
- (void) onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData;
|
||
|
||
@end
|