Advertisement
Guest User

Untitled

a guest
May 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. package tech.ivoice.apps.scenarion.bizon;
  2.  
  3. import tech.ivoice.platform.sdk.messages.Hangup;
  4. import tech.ivoice.platform.sdk.messages.Messages;
  5. import tech.ivoice.platform.sdk.messages.common.PlaySource;
  6. import tech.ivoice.platform.sdk.messages.session.PlayCollectSpeech;
  7.  
  8. import static tech.ivoice.platform.sdk.messages.Messages.playCollectSpeech;
  9.  
  10.  
  11. public class Audios {
  12.  
  13. public Audios(){
  14.  
  15. }
  16.  
  17. public PlayCollectSpeech playColleсtFirstQuestion(String date) {
  18. return playCollectSpeech(playSourceFirstQuestion(date))
  19. .setDelayBeforeCollect(12)
  20. .setKeywords("да,интересно,конечно,очень,ага,нуда,нет,не,иди,пошла")
  21. .setTimeout(8)
  22. .setWaitingInputTimeout(4)
  23. .setSilenceAfterSpeechTimeout(4)
  24. .setPartialResult(true)
  25. .build();
  26. }
  27. public PlayCollectSpeech playCollectRepeatFirstQuestion(){
  28. return playCollectSpeech(playSourceRepeatFirstQuestion())
  29. .setDelayBeforeCollect(12)
  30. .setKeywords("да,интересно,конечно,очень,ага,нуда,нет,не,иди,пошла")
  31. .setTimeout(8)
  32. .setWaitingInputTimeout(4)
  33. .setSilenceAfterSpeechTimeout(4)
  34. .setPartialResult(true)
  35. .build();
  36. }
  37.  
  38.  
  39. private PlaySource playSourceFirstQuestion(String date) {
  40. return PlaySource.sequence("wav", PlaySource.speechSynthesis("date"),
  41. "мы будем рады видеть Вас снова и приглашаем на бесплатную диагностику ходовой части. А так же, если Вы приобретете у нас масло с фильтром или амортизаторы," +
  42. " мы заменим их совершенно бесплатно."+
  43.  
  44. "Вам интересно наше предложение? Скажите ДА или НЕТ.");
  45.  
  46. }
  47. private PlaySource playSourceRepeatFirstQuestion(){
  48. return PlaySource.urls("Извините, я Вас не поняла. Скажите пожалуйста ДА или НЕТ");
  49. }
  50.  
  51. public PlaySource playSourceIfYes(){
  52. return PlaySource.urls("Отлично, соединяю с диспетчерской службой.");
  53. }
  54.  
  55. public PlaySource playSourceIfNo(){
  56. return PlaySource.urls("Спасибо за ответ! Надеемся быть Вам полезными в будущем.");
  57. }
  58.  
  59. public PlaySource playSourceRedirect(){
  60. return PlaySource.urls("Извините, я Вас не поняла. Соединяю с диспетчерской службой!");
  61. }
  62.  
  63.  
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement