IFlySpeechSynthesizerDelegate.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // IFlySpeechSynthesizerDelegate.h
  3. // MSC
  4. //
  5. // Created by ypzhao on 13-3-20.
  6. // Copyright (c) 2013年 iflytek. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "IFlySpeechEvent.h"
  10. @class IFlySpeechError;
  11. /**
  12. * 语音合成回调
  13. */
  14. @protocol IFlySpeechSynthesizerDelegate <NSObject>
  15. @required
  16. /**
  17. * 结束回调
  18. * 当整个合成结束之后会回调此函数
  19. *
  20. * @param error 错误码
  21. */
  22. - (void) onCompleted:(IFlySpeechError*) error;
  23. @optional
  24. /**
  25. * 开始合成回调
  26. */
  27. - (void) onSpeakBegin;
  28. /**
  29. * 缓冲进度回调
  30. *
  31. * @param progress 缓冲进度,0-100
  32. * @param msg 附件信息,此版本为nil
  33. */
  34. - (void) onBufferProgress:(int) progress message:(NSString *)msg;
  35. /**
  36. * 播放进度回调
  37. *
  38. * @param progress 当前播放进度,0-100
  39. * @param beginPos 当前播放文本的起始位置,0-100
  40. * @param endPos 当前播放文本的结束位置,0-100
  41. */
  42. - (void) onSpeakProgress:(int) progress beginPos:(int)beginPos endPos:(int)endPos;
  43. /**
  44. * 暂停播放回调
  45. */
  46. - (void) onSpeakPaused;
  47. /**
  48. * 恢复播放回调
  49. */
  50. - (void) onSpeakResumed;
  51. /**
  52. * 正在取消回调
  53. * 当调用`cancel`之后会回调此函数
  54. */
  55. - (void) onSpeakCancel;
  56. /**
  57. * 扩展事件回调
  58. * 根据事件类型返回额外的数据
  59. *
  60. * @param eventType 事件类型,具体参见IFlySpeechEventType枚举。目前只支持EVENT_TTS_BUFFER也就是实时返回合成音频。
  61. * @param arg0 arg0
  62. * @param arg1 arg1
  63. * @param eventData 事件数据
  64. */
  65. - (void) onEvent:(int)eventType arg0:(int)arg0 arg1:(int)arg1 data:(NSData *)eventData;
  66. @end