audio-paragraphs.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. const config = `
  2. <View>
  3. <Audio name="audio" value="$url" hotkey="space" sync="text" />
  4. <Header value="Sentiment"/>
  5. <ParagraphLabels name="label" toName="text">
  6. <Label value="General: Positive" background="#00ff00"/>
  7. <Label value="General: Negative" background="#ff0000"/>
  8. <Label value="Company: Positive" background="#7dff7d"/>
  9. <Label value="Company: Negative" background="#ff7d7d"/>
  10. <Label value="External: Positive" background="#4bff4b"/>
  11. <Label value="External: Negative" background="#ff4b4b"/>
  12. </ParagraphLabels>
  13. <View style="height: 400px; overflow-y: auto">
  14. <Header value="Transcript"/>
  15. <Paragraphs audioUrl="$url" sync="audio" name="text" value="$text" layout="dialogue" textKey="text" nameKey="author" showplayer="true" />
  16. </View>
  17. </View>
  18. `;
  19. const data = {
  20. url: "/public/files/barradeen-emotional.mp3",
  21. text: [
  22. {
  23. end: 5.6,
  24. text: "Dont you hate that?",
  25. start: 3.1,
  26. author: "Mia Wallace",
  27. },
  28. {
  29. text: "Hate what?",
  30. start: 4.2,
  31. author: "Vincent Vega:",
  32. duration: 3.1,
  33. },
  34. {
  35. text: "Uncomfortable silences. Why do we feel its necessary to yak about nonsense in order to be comfortable?",
  36. author: "Mia Wallace:",
  37. },
  38. {
  39. text: "I dont know. Thats a good question.",
  40. start: 90,
  41. author: "Vincent Vega:",
  42. },
  43. {
  44. text: "Thats when you know you found somebody really special. When you can just shut the door closed a minute, and comfortably share silence.",
  45. author: "Mia Wallace:",
  46. },
  47. ],
  48. };
  49. const result = [
  50. {
  51. value: {
  52. start: "0",
  53. end: "0",
  54. startOffset: 0,
  55. endOffset: 4,
  56. text: "Dont",
  57. paragraphlabels: ["General: Negative"],
  58. },
  59. id: "RcHv5CdYBt",
  60. from_name: "label",
  61. to_name: "text",
  62. type: "paragraphlabels",
  63. origin: "manual",
  64. },
  65. {
  66. value: {
  67. start: "0",
  68. end: "0",
  69. startOffset: 9,
  70. endOffset: 13,
  71. text: "hate",
  72. paragraphlabels: ["General: Positive"],
  73. },
  74. id: "eePG7PVYH7",
  75. from_name: "label",
  76. to_name: "text",
  77. type: "paragraphlabels",
  78. origin: "manual",
  79. },
  80. {
  81. value: {
  82. start: "2",
  83. end: "2",
  84. startOffset: 20,
  85. endOffset: 72,
  86. text: "es. Why do we feel its necessary to yak about nonsen",
  87. paragraphlabels: ["External: Positive"],
  88. },
  89. id: "-GrFBNGB9G",
  90. from_name: "label",
  91. to_name: "text",
  92. type: "paragraphlabels",
  93. origin: "manual",
  94. },
  95. {
  96. value: {
  97. start: "3",
  98. end: "3",
  99. startOffset: 7,
  100. endOffset: 14,
  101. text: "know. T",
  102. paragraphlabels: ["Company: Positive"],
  103. },
  104. id: "llFGFq3jFt",
  105. from_name: "label",
  106. to_name: "text",
  107. type: "paragraphlabels",
  108. origin: "manual",
  109. },
  110. ];
  111. const title = "Audio Paragraphs";
  112. module.exports = { config, data, result, title };