├── .github ├── FUNDING.yml └── workflows │ └── codeql-analysis.yml ├── .gitignore ├── LICENSE ├── README.md ├── SECURITY.md ├── css ├── bulma.min.css ├── styles-css.css ├── styles.css └── trint-player.css ├── data ├── deepspeech.json ├── demo.json ├── demo_hi.mp3 ├── demo_lo.mp3 ├── igor.json ├── revai-short.json ├── revai-speakers.json └── revai.json ├── favicon.ico ├── images ├── audacity.png ├── scription-logo.svg └── scription-screenshot.png ├── index.html ├── javascript ├── bulma.js ├── dark-mode-footer.js ├── dark-mode.js ├── display.js ├── editor.js ├── hyperaudio-lite.js ├── save.js ├── tooltip.js ├── trint-player.js └── unused │ ├── index copy.js │ ├── index-express.js │ ├── index.js │ └── requests.js ├── package-lock.json ├── package.json └── todo.MD /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: saml 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '30 3 * * 4' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | language: [ 'javascript' ] 32 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 33 | # Learn more: 34 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v2 39 | 40 | # Initializes the CodeQL tools for scanning. 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v1 43 | with: 44 | languages: ${{ matrix.language }} 45 | # If you wish to specify custom queries, you can do so here or in a config file. 46 | # By default, queries listed here will override any specified in a config file. 47 | # Prefix the list here with "+" to use these queries and those in the config file. 48 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 49 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 51 | # If this step fails, then you should remove it and run the build manually (see below) 52 | - name: Autobuild 53 | uses: github/codeql-action/autobuild@v1 54 | 55 | # ℹ️ Command-line programs to run using the OS shell. 56 | # 📚 https://git.io/JvXDl 57 | 58 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 59 | # and modify them (or add more) to build your code if your project 60 | # uses a compiled language 61 | 62 | #- run: | 63 | # make bootstrap 64 | # make release 65 | 66 | - name: Perform CodeQL Analysis 67 | uses: github/codeql-action/analyze@v1 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # audio files 2 | 3 | #*.mp3 4 | *.m4a 5 | #*.wav 6 | 7 | #distribution 8 | dist 9 | 10 | # user files 11 | user/ 12 | 13 | # node 14 | node_modules 15 | 16 | # save data 17 | saves 18 | 19 | .DS_Store 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Scription ✍️ 2 | 3 | Scription is an editor for automated transcription services like [Amazon Transcribe](https://aws.amazon.com/transcribe/) and [Mozilla Deepspeech](https://github.com/mozilla/DeepSpeech). It links transcript text to audio playback to bring love and joy to the transcription process ❤️ 4 | 5 | Visit the [Scription web app](https://smlum.github.io/scription/). 6 | 7 | The project is no longer in active development. 8 | 9 | ## What Scription does 10 | 11 | * Highlight and scroll text as the audio plays 12 | * Control audio playback by clicking words in the text 13 | * Skip around in the audio with keyboard shortcuts 14 | 15 | And some other useful stuff: 16 | 17 | * Highlight quotes and export them to csv 18 | * Seperate speech by speakers (AWS) 19 | * Highlight low confidence words (AWS) 20 | * Add punctuation (AWS) 21 | 22 | ## Get started 23 | 24 | ### Basic usage 25 | 26 | 1. Run a transcription job using [Amazon Transcribe](https://aws.amazon.com/transcribe/) or [Mozilla Deepspeech](https://github.com/mozilla/DeepSpeech) 27 | 2. Download the json output file 28 | 3. Load the json file into [Scription](https://smlum.github.io/scription/) 29 | 4. Load in your corresponding audio (see below for large audio files) 30 | 5. You're good to go! 31 | 32 | ### Saving and loading a project 33 | 34 | 'Save project' creates a text file which you can load into Scription at a later time. It preserves any text edits and annotations. 35 | 36 | If you have 'Autosave' turned on it saves your edits every 5 seconds using cookies. This is less secure, but if you refresh the page, they should still be there. 37 | 38 | ### Exporting 39 | 40 | 'Export text' creates a plain text file which includes the speaker tags - essentially the same thing as copy and pasting. 41 | 42 | 'Export annotations' creates a csv file with highlighted quotes by each category. 43 | 44 | ### Audio control shortcuts 45 | 46 | Audio playback can be controlled using keyboard shortcuts: 47 | 48 | * Go back 5s Ctrl + , 49 | * Skip 5s Ctrl + . 50 | * Slow down Ctrl + Shift + , 51 | * Speed up Ctrl + Shift + . 52 | 53 | ### Uploading large audio files to Scription 54 | 55 | Large audio files (above ~50mb) can cause playback issues. So can files with variable bitrates. Ideally you want the files to be less than 50mb. 56 | 57 | To get around this you can compress audio down to a small file size. I recommend using a lossy file format (like mp3). It also helps to format it to mono, use a constant bitrate and reduce the bitrate. 58 | 59 | You can manually adjust these using something like [Audacity's](https://www.audacityteam.org/) "export to mp3", for example: 60 | 61 | 62 | 63 | This can be a pain for multiple files. I used the following [ffmpeg](https://ffmpeg.org/) script to iterate through a folder of mp3 files, change the bitrates and sample rates to 8k, change to mono and save new audio files with the '.min.mp3' suffix: 64 | 65 | ` 66 | find ./ -name “*.mp3” -exec ffmpeg -i "{}" -codec:a libmp3lame -b:a 8k -ac 1 -ar 8000 '$(basename {} min)’.mp3 \; 67 | ` 68 | 69 | ## Comparing AWS Transcribe and Mozilla DeepSpeech 70 | 71 | Amazon and Mozilla both offer automated speech-to-text services. 72 | 73 | Amazon has a (fairly) easy to use web user interface, high accuracy and has lots of useful features, like speaker identification, custom volcabulary and punctuation. However, it costs money (1.44 per hour) and requires you to store data on their servers, which could be a privacy concern. 74 | 75 | DeepSpeech is free and runs locally on your machine, so there are no privacy concerns. However, it requires you to download and run their pre-trained model using python from the command line. The accuracy is pretty average. You need to add your own punctuation, correct specialised volcabulary and seperate speakers. It also requires specific audio formats. 76 | 77 | A quick comparison I considered price, setup, privacy, performance and features. 78 | 79 | || AWS Transcribe | Mozilla DeepSpeech | 80 | |---| ------------- |:-------------:| 81 | |cost| [~1.44usd per hour](https://aws.amazon.com/transcribe/pricing/) | free | 82 | |setup| web user interface | python/command line | 83 | |privacy| data saved on Amazon's servers | data saved locally | 84 | |accuracy| good | ok | 85 | |features| [lots](https://aws.amazon.com/transcribe/features/) | text only | 86 | 87 | There are other big tech speech-to-text services from Google, IBM and Microsoft. 88 | 89 | ### Setup AWS Transcribe 90 | 91 | * Follow their [instructions](https://aws.amazon.com/getting-started/hands-on/create-audio-transcript-transcribe/) 92 | * Requires setting up an account, S3 bucket, adding payment info, creating a job on Transcribe. 93 | 94 | ### Setup Mozilla DeepSpeech 95 | 96 | * Follow their [instructions](https://deepspeech.readthedocs.io/en/latest/?badge=latest) 97 | * Helps to have some basic familiarity with python and command line 98 | * They have quite tight requirements for audio formats. It needs to be .wav, mono, sample rate 16000hz. 99 | 100 | ### Cleaning audio for transcription 101 | 102 | To use automated transcription services you may need to format audio in a particular way or clean it up (eg remove noise). I recommend [Audacity](https://www.audacityteam.org/) for manual audio editing/formatting or [ffmpeg](https://ffmpeg.org/) for automated batch formatting. 103 | 104 | ## Run Scription locally 105 | 106 | 1. Clone the repository: 107 | ``` 108 | git clone https://github.com/smlum/scription 109 | cd scription 110 | ``` 111 | 112 | 2. Install packages (requires [node](https://nodejs.org/en/download/)) 113 | ``` 114 | npm run install 115 | ``` 116 | 117 | 3. Run on a local server 118 | ``` 119 | npm run start 120 | ``` 121 | or for development (with browser sync): 122 | ``` 123 | npm run dev 124 | ``` 125 | 126 | ## Privacy 127 | 128 | The Scription web app uses your browser's local storage. Nothing is uploaded onto another server using the app. 129 | 130 | ## Contributing 131 | 132 | Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change. 133 | 134 | ## Credits 135 | 136 | Scription is built using [Bulma](https://bulma.io/) and [hyperaudio](https://github.com/hyperaudio) 137 | 138 | Thanks to [likeleto](https://github.com/likeleto) for adding Google and Yandex support. 139 | 140 | ## Support 141 | 142 | If you need some help to setup scription or want to ask a question, feel free to reach out or create an issue :) 143 | 144 | ## License 145 | 146 | scription was created by [Sam Lumley](https://samlumley.page) and is licensed under the open source [AGPLv3 license](https://github.com/smlum/scription/blob/master/LICENSE). If you're interested in using it in a proprietary application feel free to get in touch! 147 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /css/styles-css.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #21a094; 3 | --selected-blue: #d2e4f9; 4 | --selected-red: #fecbcf; 5 | --selected-yellow: #fbeed1; 6 | --selected-orange: #fedecd; 7 | --selected-pink: #f8cde6; 8 | --selected-green: #cde7e2; 9 | --selected-purple: #e1d2f9; 10 | --primary-text: #1a1916; 11 | --body-bg: #fafafa; 12 | --body-color: #555; 13 | --link-color: #222; 14 | --link-color-hover: #000; 15 | --drop-bg: #f5f5f5; 16 | --nav-bg: #f5f5f5; 17 | --audio-bg: rgba(255, 255, 255, 1.00); 18 | --title-color: ; 19 | --transcript-bg: ; 20 | --transcript-ol: ; 21 | --select-bg: ; 22 | --cat-weight: 400; 23 | --tag-color: rgba(0, 0, 0, 0.7); 24 | --text-border-color: #dbdbdb; 25 | --switch-bg: #b5b5b5; 26 | --placeholder-color: rgb(122, 122, 122); 27 | --logo-color: 0; 28 | } 29 | 30 | /* dark theme */ 31 | [data-theme="dark"] { 32 | /* @media (prefers-color-scheme: dark) { */ 33 | /* :root { */ 34 | --body-bg: #2f3437; 35 | --body-color: #e7e7e7; 36 | --link-color: #dee2e6; 37 | --link-color-hover: #fff; 38 | --nav-bg: #373c3f; 39 | --audio-bg: ; 40 | --title-color: #ebebeb; 41 | --transcript-bg: ; 42 | --transcript-ol: ; 43 | --select-bg: #25282a; 44 | --icon-color: #8f9295; 45 | --drop-bg: #3f4447; 46 | --selected-blue: #487089; 47 | --selected-red: #9f5b58; 48 | --selected-yellow: #9f914a; 49 | --selected-orange: #9f7346; 50 | --selected-pink: #904c74; 51 | --selected-green: #457771; 52 | --selected-purple: #6c5990; 53 | --selected-grey: none; 54 | --primary-text: #ebebeb; 55 | --tag-color: #ebebeb; 56 | --text-border-color: #25282a; 57 | --cat-weight: 600; 58 | --switch-bg: #25282a; 59 | --audio-icon: #e7e7e7; 60 | --font-weight: 500; 61 | --placeholder-color: rgb(122, 122, 122); 62 | --logo-color: 1; 63 | } 64 | 65 | .logo { 66 | height: 30px; 67 | /* fill: var(--logo-color) !important; */ 68 | stroke: yellow !important; 69 | filter: invert(var(--logo-color)); 70 | } 71 | 72 | ::placeholder { 73 | color: var(--placeholder-color) !important; 74 | } 75 | 76 | button { 77 | font-weight: bold; 78 | } 79 | 80 | *:focus { 81 | outline: none; 82 | } 83 | 84 | .textarea { 85 | border-color: var(--text-border-color) !important; 86 | } 87 | 88 | label { 89 | white-space: nowrap; 90 | font-weight: var(--font-weight); 91 | } 92 | 93 | .scroller { 94 | scrollbar-color: var(--select-bg) var(--body-bg); 95 | } 96 | 97 | .drop-content { 98 | background-color: var(--drop-bg) !important; 99 | } 100 | 101 | .icon { 102 | color: var(--icon-color); 103 | } 104 | 105 | .title, 106 | .content { 107 | color: var(--title-color); 108 | } 109 | 110 | .navbar, 111 | .is-light { 112 | background-color: var(--nav-bg); 113 | color: var(--body-color); 114 | } 115 | 116 | a, 117 | .navbar-time { 118 | color: var(--body-color) !important; 119 | } 120 | 121 | #hypertranscript { 122 | background-color: var(--transcript-bg); 123 | color: var(--body-color); 124 | font-weight: var(--font-weight); 125 | } 126 | 127 | select, 128 | .select, 129 | input { 130 | background-color: var(--select-bg) !important; 131 | border-color: var(--text-border-color) !important; 132 | color: var(--body-color) !important; 133 | } 134 | 135 | label { 136 | color: var(--body-color); 137 | } 138 | 139 | .play-pause-btn__icon, .volume__speaker { 140 | fill: var(--audio-icon); 141 | } 142 | 143 | div .controls { 144 | color: var(--body-color); 145 | } 146 | 147 | .select::after { 148 | border-color: var(--icon-color) !important; 149 | } 150 | 151 | .accordion { 152 | background-color: var(--body-bg); 153 | } 154 | 155 | .green-audio-player, .controls { 156 | background-color: var(--nav-bg); 157 | color: var(--body-color) !important; 158 | } 159 | 160 | .pin { 161 | background-color: var(--primary) !important; 162 | } 163 | 164 | ::selection { 165 | background: rgba(210, 161, 0, 0.192); 166 | /* WebKit/Blink Browsers */ 167 | } 168 | 169 | /* html { 170 | height: 100%; 171 | } */ 172 | 173 | body, html { 174 | height: 95vh; 175 | background-color: var(--body-bg); 176 | overflow: hidden; 177 | } 178 | 179 | .full-height { 180 | height: 100%; 181 | } 182 | 183 | /* don't allow tags to be editable over multiple lines */ 184 | .single-line { 185 | overflow: hidden; 186 | } 187 | 188 | /* highlight shadow effect on category selection */ 189 | @keyframes highlightt { 190 | 0% { 191 | -webkit-box-shadow: 0px 0px 8px 4px rgba(184, 184, 184, 0.61); 192 | -moz-box-shadow: 0px 0px 8px 4px rgba(184, 184, 184, 0.61); 193 | box-shadow: 0px 0px 8px 4px rgba(184, 184, 184, 0.61); 194 | } 195 | 196 | 100% {} 197 | } 198 | 199 | .highlightt { 200 | animation: highlightt 3s; 201 | } 202 | 203 | .tag-text { 204 | color: var(--tag-color) 205 | } 206 | 207 | .drop-content { 208 | max-width: 250px; 209 | } 210 | 211 | .annotation-section { 212 | height: 100%; 213 | overflow-y: scroll; 214 | } 215 | 216 | [contenteditable="true"].single-line br { 217 | display: none; 218 | } 219 | 220 | .no-right-padding { 221 | padding-right: 0px; 222 | } 223 | 224 | .green-audio-player { 225 | min-width: 350px; 226 | } 227 | 228 | .full-width { 229 | width: 100%; 230 | } 231 | 232 | .accordion { 233 | cursor: pointer; 234 | padding-bottom: 5px; 235 | width: 100%; 236 | border: none; 237 | text-align: left; 238 | outline: none; 239 | font-size: 15px; 240 | transition: 0.4s; 241 | } 242 | 243 | /* .active-accordion, .accordion:hover { 244 | background-color: #ccc; 245 | } */ 246 | 247 | .panel { 248 | padding: 0 18px; 249 | display: none; 250 | overflow: hidden; 251 | min-height: 50px; 252 | background-color: var(--drop-bg) !important; 253 | color: var(--primary-text); 254 | } 255 | 256 | 257 | .link { 258 | color: var(--color-primary); 259 | } 260 | 261 | .low-confidence { 262 | background-color: rgba(238, 20, 4, 0.301) !important; 263 | } 264 | 265 | .not-interactive { 266 | color: var(--primary-text) !important; 267 | } 268 | 269 | .selected { 270 | color: var(--tag-color); 271 | } 272 | 273 | .selected-1 { 274 | background-color: var(--selected-orange); 275 | } 276 | 277 | .selected-2 { 278 | background-color: var(--selected-yellow); 279 | } 280 | 281 | .selected-3 { 282 | background-color: var(--selected-green); 283 | } 284 | 285 | .selected-4 { 286 | background-color: var(--selected-blue); 287 | } 288 | 289 | .selected-5 { 290 | background-color: var(--selected-purple); 291 | } 292 | 293 | .selected-6 { 294 | background-color: var(--selected-pink); 295 | } 296 | 297 | .selected-7 { 298 | background-color: var(--selected-red); 299 | } 300 | 301 | .selected-remove { 302 | background-color: var(--selected-grey) !important; 303 | } 304 | 305 | .button-1 { 306 | background-color: var(--selected-blue); 307 | } 308 | 309 | .button-2 { 310 | background-color: var(--selected-red); 311 | } 312 | 313 | .button-3 { 314 | background-color: var(--selected-yellow); 315 | } 316 | 317 | .button-4 { 318 | background-color: var(--selected-orange); 319 | } 320 | 321 | .button-5 { 322 | background-color: var(--selected-pink); 323 | } 324 | 325 | .button-6 { 326 | background-color: var(--selected-green); 327 | } 328 | 329 | .button-7 { 330 | background-color: var(--selected-purple); 331 | } 332 | 333 | .accordion-category { 334 | color: var(--tag-color) !important; 335 | font-weight: var(--cat-weight); 336 | } 337 | 338 | .category-1 { 339 | background-color: var(--selected-orange) !important; 340 | } 341 | 342 | .category-2 { 343 | background-color: var(--selected-yellow) !important; 344 | } 345 | 346 | .category-3 { 347 | background-color: var(--selected-green) !important; 348 | } 349 | 350 | .category-4 { 351 | background-color: var(--selected-blue) !important; 352 | } 353 | 354 | .category-5 { 355 | background-color: var(--selected-purple) !important; 356 | } 357 | 358 | .category-6 { 359 | background-color: var(--selected-pink) !important; 360 | } 361 | 362 | .category-7 { 363 | background-color: var(--selected-red) !important; 364 | } 365 | 366 | .category-remove { 367 | background-color: var(--selected-grey) !important; 368 | } 369 | 370 | .annotation-button { 371 | color: var(--primary-text); 372 | border: none; 373 | border-radius: 3px; 374 | font-size: 11.5pt; 375 | padding-top: 0px; 376 | padding-bottom: 0px; 377 | } 378 | 379 | .drop-content { 380 | -webkit-box-shadow: 0px 9px 25px -13px rgba(0, 0, 0, 0.57); 381 | -moz-box-shadow: 0px 9px 25px -13px rgba(0, 0, 0, 0.57); 382 | box-shadow: 0px 9px 25px -13px rgba(0, 0, 0, 0.57); 383 | padding: 12px !important; 384 | } 385 | 386 | .drop-content::before { 387 | border-bottom-color: white !important; 388 | } 389 | 390 | .temporary-link { 391 | color: #21a094 !important; 392 | } -------------------------------------------------------------------------------- /css/trint-player.css: -------------------------------------------------------------------------------- 1 | /* Trint Styles */ 2 | 3 | #hypertranscript .strikethrough { 4 | text-decoration: line-through; 5 | } 6 | 7 | #hypertranscript .annotation, 8 | #hypertranscript .parannotation { 9 | opacity: 0.7; 10 | } 11 | 12 | #hypertranscript span.highlight-true { 13 | background-color: rgba(255, 207, 1, 0.36) !important; 14 | } 15 | 16 | #hypertranscript span.highlight-blue { 17 | background-color: rgba(96, 160, 255, 0.36) !important; 18 | } 19 | 20 | #hypertranscript span.highlight-green { 21 | background-color: rgba(90, 171, 0, 0.36) !important; 22 | } 23 | 24 | #hypertranscript span.highlight-red { 25 | background-color: rgba(255, 0, 89, 0.36) !important; 26 | } 27 | 28 | #hypertranscript span.highlight-purple { 29 | background-color: rgba(221, 86, 249, 0.36) !important; 30 | } 31 | 32 | #hypertranscript header { 33 | font-size: 200%; 34 | } 35 | 36 | #hypertranscript a { 37 | cursor: pointer; 38 | color: #000; 39 | } 40 | 41 | #hypertranscript { 42 | color: rgb(31, 31, 31); 43 | } 44 | 45 | 46 | #hypertranscript .active ~ span { 47 | color: rgb(122, 122, 122); 48 | } 49 | 50 | #hypertranscript p.active ~ p span { 51 | color: rgb(122, 122, 122); 52 | } 53 | 54 | #hypertranscript span.search-match { 55 | background-color: rgb(156, 172, 199); 56 | } 57 | 58 | #hypertranscript sub:before { 59 | content: '\231C'; 60 | } 61 | 62 | #hypertranscript sub.highlight-duration:before { 63 | content: '\231D'; 64 | } 65 | 66 | /* drop.js / trint-player-share.js Twitter Styles */ 67 | 68 | a.sharelink { 69 | color: #dddddd; 70 | } 71 | 72 | a.sharelink:hover { 73 | color: #ffffff; 74 | } 75 | -------------------------------------------------------------------------------- /data/demo.json: -------------------------------------------------------------------------------- 1 | { 2 | "jobName": "demo2", 3 | "accountId": "", 4 | "results": { 5 | "transcripts": [ 6 | { 7 | "transcript": "transcription body combines the brute force of automated transcription with an interactive editor. It links text audio playback, making it easier to scan through a transcript to fix any errors and extract useful information. The objective is to make this speech to text process quicker, cheaper, on a bit more enjoyable." 8 | } 9 | ], 10 | "speaker_labels": { 11 | "speakers": 2, 12 | "segments": [ 13 | { 14 | "start_time": "0.34", 15 | "speaker_label": "spk_0", 16 | "end_time": "1.49", 17 | "items": [ 18 | { 19 | "start_time": "0.34", 20 | "speaker_label": "spk_0", 21 | "end_time": "0.94" 22 | }, 23 | { 24 | "start_time": "0.94", 25 | "speaker_label": "spk_0", 26 | "end_time": "1.15" 27 | }, 28 | { 29 | "start_time": "1.15", 30 | "speaker_label": "spk_0", 31 | "end_time": "1.49" 32 | } 33 | ] 34 | }, 35 | { 36 | "start_time": "1.49", 37 | "speaker_label": "spk_1", 38 | "end_time": "2.27", 39 | "items": [ 40 | { 41 | "start_time": "1.49", 42 | "speaker_label": "spk_1", 43 | "end_time": "1.57" 44 | }, 45 | { 46 | "start_time": "1.57", 47 | "speaker_label": "spk_1", 48 | "end_time": "1.94" 49 | }, 50 | { 51 | "start_time": "1.94", 52 | "speaker_label": "spk_1", 53 | "end_time": "2.27" 54 | } 55 | ] 56 | }, 57 | { 58 | "start_time": "2.27", 59 | "speaker_label": "spk_0", 60 | "end_time": "5.37", 61 | "items": [ 62 | { 63 | "start_time": "2.27", 64 | "speaker_label": "spk_0", 65 | "end_time": "2.46" 66 | }, 67 | { 68 | "start_time": "2.47", 69 | "speaker_label": "spk_0", 70 | "end_time": "3.05" 71 | }, 72 | { 73 | "start_time": "3.05", 74 | "speaker_label": "spk_0", 75 | "end_time": "3.87" 76 | }, 77 | { 78 | "start_time": "3.88", 79 | "speaker_label": "spk_0", 80 | "end_time": "4.15" 81 | }, 82 | { 83 | "start_time": "4.15", 84 | "speaker_label": "spk_0", 85 | "end_time": "4.26" 86 | }, 87 | { 88 | "start_time": "4.27", 89 | "speaker_label": "spk_0", 90 | "end_time": "4.9" 91 | }, 92 | { 93 | "start_time": "4.91", 94 | "speaker_label": "spk_0", 95 | "end_time": "5.37" 96 | } 97 | ] 98 | }, 99 | { 100 | "start_time": "6.4", 101 | "speaker_label": "spk_0", 102 | "end_time": "13.81", 103 | "items": [ 104 | { 105 | "start_time": "6.4", 106 | "speaker_label": "spk_0", 107 | "end_time": "6.58" 108 | }, 109 | { 110 | "start_time": "6.58", 111 | "speaker_label": "spk_0", 112 | "end_time": "7.04" 113 | }, 114 | { 115 | "start_time": "7.04", 116 | "speaker_label": "spk_0", 117 | "end_time": "7.46" 118 | }, 119 | { 120 | "start_time": "7.46", 121 | "speaker_label": "spk_0", 122 | "end_time": "7.84" 123 | }, 124 | { 125 | "start_time": "7.84", 126 | "speaker_label": "spk_0", 127 | "end_time": "8.51" 128 | }, 129 | { 130 | "start_time": "8.78", 131 | "speaker_label": "spk_0", 132 | "end_time": "9.07" 133 | }, 134 | { 135 | "start_time": "9.07", 136 | "speaker_label": "spk_0", 137 | "end_time": "9.16" 138 | }, 139 | { 140 | "start_time": "9.17", 141 | "speaker_label": "spk_0", 142 | "end_time": "9.55" 143 | }, 144 | { 145 | "start_time": "9.55", 146 | "speaker_label": "spk_0", 147 | "end_time": "9.69" 148 | }, 149 | { 150 | "start_time": "9.69", 151 | "speaker_label": "spk_0", 152 | "end_time": "10.11" 153 | }, 154 | { 155 | "start_time": "10.11", 156 | "speaker_label": "spk_0", 157 | "end_time": "10.26" 158 | }, 159 | { 160 | "start_time": "10.26", 161 | "speaker_label": "spk_0", 162 | "end_time": "10.32" 163 | }, 164 | { 165 | "start_time": "10.32", 166 | "speaker_label": "spk_0", 167 | "end_time": "11.06" 168 | }, 169 | { 170 | "start_time": "11.11", 171 | "speaker_label": "spk_0", 172 | "end_time": "11.25" 173 | }, 174 | { 175 | "start_time": "11.25", 176 | "speaker_label": "spk_0", 177 | "end_time": "11.56" 178 | }, 179 | { 180 | "start_time": "11.56", 181 | "speaker_label": "spk_0", 182 | "end_time": "11.74" 183 | }, 184 | { 185 | "start_time": "11.74", 186 | "speaker_label": "spk_0", 187 | "end_time": "12.25" 188 | }, 189 | { 190 | "start_time": "12.26", 191 | "speaker_label": "spk_0", 192 | "end_time": "12.38" 193 | }, 194 | { 195 | "start_time": "12.38", 196 | "speaker_label": "spk_0", 197 | "end_time": "12.84" 198 | }, 199 | { 200 | "start_time": "12.84", 201 | "speaker_label": "spk_0", 202 | "end_time": "13.22" 203 | }, 204 | { 205 | "start_time": "13.22", 206 | "speaker_label": "spk_0", 207 | "end_time": "13.81" 208 | } 209 | ] 210 | }, 211 | { 212 | "start_time": "14.74", 213 | "speaker_label": "spk_0", 214 | "end_time": "20.35", 215 | "items": [ 216 | { 217 | "start_time": "14.74", 218 | "speaker_label": "spk_0", 219 | "end_time": "14.84" 220 | }, 221 | { 222 | "start_time": "14.84", 223 | "speaker_label": "spk_0", 224 | "end_time": "15.5" 225 | }, 226 | { 227 | "start_time": "15.79", 228 | "speaker_label": "spk_0", 229 | "end_time": "15.94" 230 | }, 231 | { 232 | "start_time": "15.94", 233 | "speaker_label": "spk_0", 234 | "end_time": "16.02" 235 | }, 236 | { 237 | "start_time": "16.02", 238 | "speaker_label": "spk_0", 239 | "end_time": "16.21" 240 | }, 241 | { 242 | "start_time": "16.21", 243 | "speaker_label": "spk_0", 244 | "end_time": "16.3" 245 | }, 246 | { 247 | "start_time": "16.3", 248 | "speaker_label": "spk_0", 249 | "end_time": "16.68" 250 | }, 251 | { 252 | "start_time": "16.68", 253 | "speaker_label": "spk_0", 254 | "end_time": "16.81" 255 | }, 256 | { 257 | "start_time": "16.81", 258 | "speaker_label": "spk_0", 259 | "end_time": "17.17" 260 | }, 261 | { 262 | "start_time": "17.17", 263 | "speaker_label": "spk_0", 264 | "end_time": "17.58" 265 | }, 266 | { 267 | "start_time": "17.58", 268 | "speaker_label": "spk_0", 269 | "end_time": "18.13" 270 | }, 271 | { 272 | "start_time": "18.42", 273 | "speaker_label": "spk_0", 274 | "end_time": "19.04" 275 | }, 276 | { 277 | "start_time": "19.22", 278 | "speaker_label": "spk_0", 279 | "end_time": "19.36" 280 | }, 281 | { 282 | "start_time": "19.36", 283 | "speaker_label": "spk_0", 284 | "end_time": "19.41" 285 | }, 286 | { 287 | "start_time": "19.41", 288 | "speaker_label": "spk_0", 289 | "end_time": "19.59" 290 | }, 291 | { 292 | "start_time": "19.59", 293 | "speaker_label": "spk_0", 294 | "end_time": "19.79" 295 | }, 296 | { 297 | "start_time": "19.79", 298 | "speaker_label": "spk_0", 299 | "end_time": "20.35" 300 | } 301 | ] 302 | } 303 | ] 304 | }, 305 | "items": [ 306 | { 307 | "start_time": "0.34", 308 | "end_time": "0.94", 309 | "alternatives": [ 310 | { 311 | "confidence": "1.0", 312 | "content": "transcription" 313 | } 314 | ], 315 | "type": "pronunciation" 316 | }, 317 | { 318 | "start_time": "0.94", 319 | "end_time": "1.15", 320 | "alternatives": [ 321 | { 322 | "confidence": "0.933", 323 | "content": "body" 324 | } 325 | ], 326 | "type": "pronunciation" 327 | }, 328 | { 329 | "start_time": "1.15", 330 | "end_time": "1.49", 331 | "alternatives": [ 332 | { 333 | "confidence": "0.986", 334 | "content": "combines" 335 | } 336 | ], 337 | "type": "pronunciation" 338 | }, 339 | { 340 | "start_time": "1.49", 341 | "end_time": "1.57", 342 | "alternatives": [ 343 | { 344 | "confidence": "0.819", 345 | "content": "the" 346 | } 347 | ], 348 | "type": "pronunciation" 349 | }, 350 | { 351 | "start_time": "1.57", 352 | "end_time": "1.94", 353 | "alternatives": [ 354 | { 355 | "confidence": "1.0", 356 | "content": "brute" 357 | } 358 | ], 359 | "type": "pronunciation" 360 | }, 361 | { 362 | "start_time": "1.94", 363 | "end_time": "2.27", 364 | "alternatives": [ 365 | { 366 | "confidence": "1.0", 367 | "content": "force" 368 | } 369 | ], 370 | "type": "pronunciation" 371 | }, 372 | { 373 | "start_time": "2.27", 374 | "end_time": "2.46", 375 | "alternatives": [ 376 | { 377 | "confidence": "1.0", 378 | "content": "of" 379 | } 380 | ], 381 | "type": "pronunciation" 382 | }, 383 | { 384 | "start_time": "2.47", 385 | "end_time": "3.05", 386 | "alternatives": [ 387 | { 388 | "confidence": "1.0", 389 | "content": "automated" 390 | } 391 | ], 392 | "type": "pronunciation" 393 | }, 394 | { 395 | "start_time": "3.05", 396 | "end_time": "3.87", 397 | "alternatives": [ 398 | { 399 | "confidence": "1.0", 400 | "content": "transcription" 401 | } 402 | ], 403 | "type": "pronunciation" 404 | }, 405 | { 406 | "start_time": "3.88", 407 | "end_time": "4.15", 408 | "alternatives": [ 409 | { 410 | "confidence": "1.0", 411 | "content": "with" 412 | } 413 | ], 414 | "type": "pronunciation" 415 | }, 416 | { 417 | "start_time": "4.15", 418 | "end_time": "4.26", 419 | "alternatives": [ 420 | { 421 | "confidence": "0.999", 422 | "content": "an" 423 | } 424 | ], 425 | "type": "pronunciation" 426 | }, 427 | { 428 | "start_time": "4.27", 429 | "end_time": "4.9", 430 | "alternatives": [ 431 | { 432 | "confidence": "1.0", 433 | "content": "interactive" 434 | } 435 | ], 436 | "type": "pronunciation" 437 | }, 438 | { 439 | "start_time": "4.91", 440 | "end_time": "5.37", 441 | "alternatives": [ 442 | { 443 | "confidence": "1.0", 444 | "content": "editor" 445 | } 446 | ], 447 | "type": "pronunciation" 448 | }, 449 | { 450 | "alternatives": [ 451 | { 452 | "confidence": "0.0", 453 | "content": "." 454 | } 455 | ], 456 | "type": "punctuation" 457 | }, 458 | { 459 | "start_time": "6.4", 460 | "end_time": "6.58", 461 | "alternatives": [ 462 | { 463 | "confidence": "1.0", 464 | "content": "It" 465 | } 466 | ], 467 | "type": "pronunciation" 468 | }, 469 | { 470 | "start_time": "6.58", 471 | "end_time": "7.04", 472 | "alternatives": [ 473 | { 474 | "confidence": "0.999", 475 | "content": "links" 476 | } 477 | ], 478 | "type": "pronunciation" 479 | }, 480 | { 481 | "start_time": "7.04", 482 | "end_time": "7.46", 483 | "alternatives": [ 484 | { 485 | "confidence": "0.999", 486 | "content": "text" 487 | } 488 | ], 489 | "type": "pronunciation" 490 | }, 491 | { 492 | "start_time": "7.46", 493 | "end_time": "7.84", 494 | "alternatives": [ 495 | { 496 | "confidence": "1.0", 497 | "content": "audio" 498 | } 499 | ], 500 | "type": "pronunciation" 501 | }, 502 | { 503 | "start_time": "7.84", 504 | "end_time": "8.51", 505 | "alternatives": [ 506 | { 507 | "confidence": "1.0", 508 | "content": "playback" 509 | } 510 | ], 511 | "type": "pronunciation" 512 | }, 513 | { 514 | "alternatives": [ 515 | { 516 | "confidence": "0.0", 517 | "content": "," 518 | } 519 | ], 520 | "type": "punctuation" 521 | }, 522 | { 523 | "start_time": "8.78", 524 | "end_time": "9.07", 525 | "alternatives": [ 526 | { 527 | "confidence": "1.0", 528 | "content": "making" 529 | } 530 | ], 531 | "type": "pronunciation" 532 | }, 533 | { 534 | "start_time": "9.07", 535 | "end_time": "9.16", 536 | "alternatives": [ 537 | { 538 | "confidence": "1.0", 539 | "content": "it" 540 | } 541 | ], 542 | "type": "pronunciation" 543 | }, 544 | { 545 | "start_time": "9.17", 546 | "end_time": "9.55", 547 | "alternatives": [ 548 | { 549 | "confidence": "1.0", 550 | "content": "easier" 551 | } 552 | ], 553 | "type": "pronunciation" 554 | }, 555 | { 556 | "start_time": "9.55", 557 | "end_time": "9.69", 558 | "alternatives": [ 559 | { 560 | "confidence": "1.0", 561 | "content": "to" 562 | } 563 | ], 564 | "type": "pronunciation" 565 | }, 566 | { 567 | "start_time": "9.69", 568 | "end_time": "10.11", 569 | "alternatives": [ 570 | { 571 | "confidence": "1.0", 572 | "content": "scan" 573 | } 574 | ], 575 | "type": "pronunciation" 576 | }, 577 | { 578 | "start_time": "10.11", 579 | "end_time": "10.26", 580 | "alternatives": [ 581 | { 582 | "confidence": "0.99", 583 | "content": "through" 584 | } 585 | ], 586 | "type": "pronunciation" 587 | }, 588 | { 589 | "start_time": "10.26", 590 | "end_time": "10.32", 591 | "alternatives": [ 592 | { 593 | "confidence": "0.995", 594 | "content": "a" 595 | } 596 | ], 597 | "type": "pronunciation" 598 | }, 599 | { 600 | "start_time": "10.32", 601 | "end_time": "11.06", 602 | "alternatives": [ 603 | { 604 | "confidence": "1.0", 605 | "content": "transcript" 606 | } 607 | ], 608 | "type": "pronunciation" 609 | }, 610 | { 611 | "start_time": "11.11", 612 | "end_time": "11.25", 613 | "alternatives": [ 614 | { 615 | "confidence": "1.0", 616 | "content": "to" 617 | } 618 | ], 619 | "type": "pronunciation" 620 | }, 621 | { 622 | "start_time": "11.25", 623 | "end_time": "11.56", 624 | "alternatives": [ 625 | { 626 | "confidence": "1.0", 627 | "content": "fix" 628 | } 629 | ], 630 | "type": "pronunciation" 631 | }, 632 | { 633 | "start_time": "11.56", 634 | "end_time": "11.74", 635 | "alternatives": [ 636 | { 637 | "confidence": "1.0", 638 | "content": "any" 639 | } 640 | ], 641 | "type": "pronunciation" 642 | }, 643 | { 644 | "start_time": "11.74", 645 | "end_time": "12.25", 646 | "alternatives": [ 647 | { 648 | "confidence": "1.0", 649 | "content": "errors" 650 | } 651 | ], 652 | "type": "pronunciation" 653 | }, 654 | { 655 | "start_time": "12.26", 656 | "end_time": "12.38", 657 | "alternatives": [ 658 | { 659 | "confidence": "0.998", 660 | "content": "and" 661 | } 662 | ], 663 | "type": "pronunciation" 664 | }, 665 | { 666 | "start_time": "12.38", 667 | "end_time": "12.84", 668 | "alternatives": [ 669 | { 670 | "confidence": "1.0", 671 | "content": "extract" 672 | } 673 | ], 674 | "type": "pronunciation" 675 | }, 676 | { 677 | "start_time": "12.84", 678 | "end_time": "13.22", 679 | "alternatives": [ 680 | { 681 | "confidence": "1.0", 682 | "content": "useful" 683 | } 684 | ], 685 | "type": "pronunciation" 686 | }, 687 | { 688 | "start_time": "13.22", 689 | "end_time": "13.81", 690 | "alternatives": [ 691 | { 692 | "confidence": "1.0", 693 | "content": "information" 694 | } 695 | ], 696 | "type": "pronunciation" 697 | }, 698 | { 699 | "alternatives": [ 700 | { 701 | "confidence": "0.0", 702 | "content": "." 703 | } 704 | ], 705 | "type": "punctuation" 706 | }, 707 | { 708 | "start_time": "14.74", 709 | "end_time": "14.84", 710 | "alternatives": [ 711 | { 712 | "confidence": "1.0", 713 | "content": "The" 714 | } 715 | ], 716 | "type": "pronunciation" 717 | }, 718 | { 719 | "start_time": "14.84", 720 | "end_time": "15.5", 721 | "alternatives": [ 722 | { 723 | "confidence": "1.0", 724 | "content": "objective" 725 | } 726 | ], 727 | "type": "pronunciation" 728 | }, 729 | { 730 | "start_time": "15.79", 731 | "end_time": "15.94", 732 | "alternatives": [ 733 | { 734 | "confidence": "1.0", 735 | "content": "is" 736 | } 737 | ], 738 | "type": "pronunciation" 739 | }, 740 | { 741 | "start_time": "15.94", 742 | "end_time": "16.02", 743 | "alternatives": [ 744 | { 745 | "confidence": "1.0", 746 | "content": "to" 747 | } 748 | ], 749 | "type": "pronunciation" 750 | }, 751 | { 752 | "start_time": "16.02", 753 | "end_time": "16.21", 754 | "alternatives": [ 755 | { 756 | "confidence": "1.0", 757 | "content": "make" 758 | } 759 | ], 760 | "type": "pronunciation" 761 | }, 762 | { 763 | "start_time": "16.21", 764 | "end_time": "16.3", 765 | "alternatives": [ 766 | { 767 | "confidence": "0.592", 768 | "content": "this" 769 | } 770 | ], 771 | "type": "pronunciation" 772 | }, 773 | { 774 | "start_time": "16.3", 775 | "end_time": "16.68", 776 | "alternatives": [ 777 | { 778 | "confidence": "1.0", 779 | "content": "speech" 780 | } 781 | ], 782 | "type": "pronunciation" 783 | }, 784 | { 785 | "start_time": "16.68", 786 | "end_time": "16.81", 787 | "alternatives": [ 788 | { 789 | "confidence": "0.998", 790 | "content": "to" 791 | } 792 | ], 793 | "type": "pronunciation" 794 | }, 795 | { 796 | "start_time": "16.81", 797 | "end_time": "17.17", 798 | "alternatives": [ 799 | { 800 | "confidence": "0.997", 801 | "content": "text" 802 | } 803 | ], 804 | "type": "pronunciation" 805 | }, 806 | { 807 | "start_time": "17.17", 808 | "end_time": "17.58", 809 | "alternatives": [ 810 | { 811 | "confidence": "1.0", 812 | "content": "process" 813 | } 814 | ], 815 | "type": "pronunciation" 816 | }, 817 | { 818 | "start_time": "17.58", 819 | "end_time": "18.13", 820 | "alternatives": [ 821 | { 822 | "confidence": "1.0", 823 | "content": "quicker" 824 | } 825 | ], 826 | "type": "pronunciation" 827 | }, 828 | { 829 | "alternatives": [ 830 | { 831 | "confidence": "0.0", 832 | "content": "," 833 | } 834 | ], 835 | "type": "punctuation" 836 | }, 837 | { 838 | "start_time": "18.42", 839 | "end_time": "19.04", 840 | "alternatives": [ 841 | { 842 | "confidence": "1.0", 843 | "content": "cheaper" 844 | } 845 | ], 846 | "type": "pronunciation" 847 | }, 848 | { 849 | "alternatives": [ 850 | { 851 | "confidence": "0.0", 852 | "content": "," 853 | } 854 | ], 855 | "type": "punctuation" 856 | }, 857 | { 858 | "start_time": "19.22", 859 | "end_time": "19.36", 860 | "alternatives": [ 861 | { 862 | "confidence": "0.806", 863 | "content": "on" 864 | } 865 | ], 866 | "type": "pronunciation" 867 | }, 868 | { 869 | "start_time": "19.36", 870 | "end_time": "19.41", 871 | "alternatives": [ 872 | { 873 | "confidence": "0.999", 874 | "content": "a" 875 | } 876 | ], 877 | "type": "pronunciation" 878 | }, 879 | { 880 | "start_time": "19.41", 881 | "end_time": "19.59", 882 | "alternatives": [ 883 | { 884 | "confidence": "1.0", 885 | "content": "bit" 886 | } 887 | ], 888 | "type": "pronunciation" 889 | }, 890 | { 891 | "start_time": "19.59", 892 | "end_time": "19.79", 893 | "alternatives": [ 894 | { 895 | "confidence": "1.0", 896 | "content": "more" 897 | } 898 | ], 899 | "type": "pronunciation" 900 | }, 901 | { 902 | "start_time": "19.79", 903 | "end_time": "20.35", 904 | "alternatives": [ 905 | { 906 | "confidence": "1.0", 907 | "content": "enjoyable" 908 | } 909 | ], 910 | "type": "pronunciation" 911 | }, 912 | { 913 | "alternatives": [ 914 | { 915 | "confidence": "0.0", 916 | "content": "." 917 | } 918 | ], 919 | "type": "punctuation" 920 | } 921 | ] 922 | }, 923 | "status": "COMPLETED" 924 | } -------------------------------------------------------------------------------- /data/demo_hi.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlum/scription/ba11ddb646b64d1d1233cca078e22037ea02521a/data/demo_hi.mp3 -------------------------------------------------------------------------------- /data/demo_lo.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlum/scription/ba11ddb646b64d1d1233cca078e22037ea02521a/data/demo_lo.mp3 -------------------------------------------------------------------------------- /data/revai-short.json: -------------------------------------------------------------------------------- 1 | { 2 | "monologues": [ 3 | { 4 | "speaker": 0, 5 | "elements": [ 6 | { 7 | "type": "text", 8 | "value": "Transcription", 9 | "ts": 0.36, 10 | "end_ts": 0.96, 11 | "confidence": 1 12 | }, 13 | { 14 | "type": "punct", 15 | "value": " " 16 | }, 17 | { 18 | "type": "text", 19 | "value": "buddy", 20 | "ts": 0.96, 21 | "end_ts": 1.17, 22 | "confidence": 0.68 23 | }, 24 | { 25 | "type": "punct", 26 | "value": " " 27 | }, 28 | { 29 | "type": "text", 30 | "value": "combines", 31 | "ts": 1.17, 32 | "end_ts": 1.53, 33 | "confidence": 1 34 | }, 35 | { 36 | "type": "punct", 37 | "value": " " 38 | }, 39 | { 40 | "type": "text", 41 | "value": "the", 42 | "ts": 1.53, 43 | "end_ts": 1.62, 44 | "confidence": 0.76 45 | }, 46 | { 47 | "type": "punct", 48 | "value": " " 49 | }, 50 | { 51 | "type": "text", 52 | "value": "brute", 53 | "ts": 1.62, 54 | "end_ts": 1.95, 55 | "confidence": 1 56 | }, 57 | { 58 | "type": "punct", 59 | "value": " " 60 | }, 61 | { 62 | "type": "text", 63 | "value": "force", 64 | "ts": 1.95, 65 | "end_ts": 2.28, 66 | "confidence": 1 67 | }, 68 | { 69 | "type": "punct", 70 | "value": " " 71 | }, 72 | { 73 | "type": "text", 74 | "value": "of", 75 | "ts": 2.28, 76 | "end_ts": 2.43, 77 | "confidence": 1 78 | }, 79 | { 80 | "type": "punct", 81 | "value": " " 82 | }, 83 | { 84 | "type": "text", 85 | "value": "automated", 86 | "ts": 2.46, 87 | "end_ts": 3.06, 88 | "confidence": 1 89 | }, 90 | { 91 | "type": "punct", 92 | "value": " " 93 | }, 94 | { 95 | "type": "text", 96 | "value": "transcription", 97 | "ts": 3.06, 98 | "end_ts": 3.84, 99 | "confidence": 1 100 | }, 101 | { 102 | "type": "punct", 103 | "value": " " 104 | }, 105 | { 106 | "type": "text", 107 | "value": "with", 108 | "ts": 3.96, 109 | "end_ts": 4.17, 110 | "confidence": 1 111 | }, 112 | { 113 | "type": "punct", 114 | "value": " " 115 | }, 116 | { 117 | "type": "text", 118 | "value": "an", 119 | "ts": 4.17, 120 | "end_ts": 4.29, 121 | "confidence": 1 122 | }, 123 | { 124 | "type": "punct", 125 | "value": " " 126 | }, 127 | { 128 | "type": "text", 129 | "value": "interactive", 130 | "ts": 4.29, 131 | "end_ts": 4.89, 132 | "confidence": 1 133 | }, 134 | { 135 | "type": "punct", 136 | "value": " " 137 | }, 138 | { 139 | "type": "text", 140 | "value": "editor", 141 | "ts": 4.89, 142 | "end_ts": 5.37, 143 | "confidence": 1 144 | }, 145 | { 146 | "type": "punct", 147 | "value": "." 148 | }, 149 | { 150 | "type": "punct", 151 | "value": " " 152 | }, 153 | { 154 | "type": "text", 155 | "value": "It", 156 | "ts": 6.42, 157 | "end_ts": 6.6, 158 | "confidence": 1 159 | }, 160 | { 161 | "type": "punct", 162 | "value": " " 163 | }, 164 | { 165 | "type": "text", 166 | "value": "links", 167 | "ts": 6.6, 168 | "end_ts": 7.05, 169 | "confidence": 1 170 | }, 171 | { 172 | "type": "punct", 173 | "value": " " 174 | }, 175 | { 176 | "type": "text", 177 | "value": "text", 178 | "ts": 7.08, 179 | "end_ts": 7.44, 180 | "confidence": 0.88 181 | }, 182 | { 183 | "type": "punct", 184 | "value": " " 185 | }, 186 | { 187 | "type": "text", 188 | "value": "to", 189 | "ts": 7.44, 190 | "end_ts": 7.5, 191 | "confidence": 1 192 | }, 193 | { 194 | "type": "punct", 195 | "value": " " 196 | }, 197 | { 198 | "type": "text", 199 | "value": "audio", 200 | "ts": 7.5, 201 | "end_ts": 7.86, 202 | "confidence": 1 203 | }, 204 | { 205 | "type": "punct", 206 | "value": " " 207 | }, 208 | { 209 | "type": "text", 210 | "value": "playback", 211 | "ts": 7.86, 212 | "end_ts": 8.52, 213 | "confidence": 1 214 | }, 215 | { 216 | "type": "punct", 217 | "value": "," 218 | }, 219 | { 220 | "type": "punct", 221 | "value": " " 222 | }, 223 | { 224 | "type": "text", 225 | "value": "making", 226 | "ts": 8.76, 227 | "end_ts": 9.09, 228 | "confidence": 1 229 | }, 230 | { 231 | "type": "punct", 232 | "value": " " 233 | }, 234 | { 235 | "type": "text", 236 | "value": "it", 237 | "ts": 9.09, 238 | "end_ts": 9.18, 239 | "confidence": 1 240 | }, 241 | { 242 | "type": "punct", 243 | "value": " " 244 | }, 245 | { 246 | "type": "text", 247 | "value": "easier", 248 | "ts": 9.18, 249 | "end_ts": 9.57, 250 | "confidence": 1 251 | }, 252 | { 253 | "type": "punct", 254 | "value": " " 255 | }, 256 | { 257 | "type": "text", 258 | "value": "to", 259 | "ts": 9.57, 260 | "end_ts": 9.72, 261 | "confidence": 1 262 | }, 263 | { 264 | "type": "punct", 265 | "value": " " 266 | }, 267 | { 268 | "type": "text", 269 | "value": "scan", 270 | "ts": 9.72, 271 | "end_ts": 10.11, 272 | "confidence": 1 273 | }, 274 | { 275 | "type": "punct", 276 | "value": " " 277 | }, 278 | { 279 | "type": "text", 280 | "value": "through", 281 | "ts": 10.11, 282 | "end_ts": 10.29, 283 | "confidence": 1 284 | }, 285 | { 286 | "type": "punct", 287 | "value": " " 288 | }, 289 | { 290 | "type": "text", 291 | "value": "a", 292 | "ts": 10.29, 293 | "end_ts": 10.35, 294 | "confidence": 1 295 | }, 296 | { 297 | "type": "punct", 298 | "value": " " 299 | }, 300 | { 301 | "type": "text", 302 | "value": "transcript", 303 | "ts": 10.35, 304 | "end_ts": 11.07, 305 | "confidence": 1 306 | }, 307 | { 308 | "type": "punct", 309 | "value": "," 310 | }, 311 | { 312 | "type": "punct", 313 | "value": " " 314 | }, 315 | { 316 | "type": "text", 317 | "value": "to", 318 | "ts": 11.13, 319 | "end_ts": 11.28, 320 | "confidence": 1 321 | }, 322 | { 323 | "type": "punct", 324 | "value": " " 325 | }, 326 | { 327 | "type": "text", 328 | "value": "fix", 329 | "ts": 11.28, 330 | "end_ts": 11.58, 331 | "confidence": 1 332 | }, 333 | { 334 | "type": "punct", 335 | "value": " " 336 | }, 337 | { 338 | "type": "text", 339 | "value": "any", 340 | "ts": 11.58, 341 | "end_ts": 11.76, 342 | "confidence": 1 343 | }, 344 | { 345 | "type": "punct", 346 | "value": " " 347 | }, 348 | { 349 | "type": "text", 350 | "value": "errors", 351 | "ts": 11.76, 352 | "end_ts": 12.24, 353 | "confidence": 1 354 | }, 355 | { 356 | "type": "punct", 357 | "value": " " 358 | }, 359 | { 360 | "type": "text", 361 | "value": "and", 362 | "ts": 12.3, 363 | "end_ts": 12.42, 364 | "confidence": 1 365 | }, 366 | { 367 | "type": "punct", 368 | "value": " " 369 | }, 370 | { 371 | "type": "text", 372 | "value": "extract", 373 | "ts": 12.42, 374 | "end_ts": 12.84, 375 | "confidence": 1 376 | }, 377 | { 378 | "type": "punct", 379 | "value": " " 380 | }, 381 | { 382 | "type": "text", 383 | "value": "useful", 384 | "ts": 12.84, 385 | "end_ts": 13.23, 386 | "confidence": 1 387 | }, 388 | { 389 | "type": "punct", 390 | "value": " " 391 | }, 392 | { 393 | "type": "text", 394 | "value": "information", 395 | "ts": 13.23, 396 | "end_ts": 13.8, 397 | "confidence": 1 398 | }, 399 | { 400 | "type": "punct", 401 | "value": "." 402 | }, 403 | { 404 | "type": "punct", 405 | "value": " " 406 | }, 407 | { 408 | "type": "text", 409 | "value": "The", 410 | "ts": 14.73, 411 | "end_ts": 14.85, 412 | "confidence": 1 413 | }, 414 | { 415 | "type": "punct", 416 | "value": " " 417 | }, 418 | { 419 | "type": "text", 420 | "value": "objective", 421 | "ts": 14.85, 422 | "end_ts": 15.45, 423 | "confidence": 1 424 | }, 425 | { 426 | "type": "punct", 427 | "value": " " 428 | }, 429 | { 430 | "type": "text", 431 | "value": "is", 432 | "ts": 15.81, 433 | "end_ts": 15.96, 434 | "confidence": 1 435 | }, 436 | { 437 | "type": "punct", 438 | "value": " " 439 | }, 440 | { 441 | "type": "text", 442 | "value": "to", 443 | "ts": 15.96, 444 | "end_ts": 16.05, 445 | "confidence": 1 446 | }, 447 | { 448 | "type": "punct", 449 | "value": " " 450 | }, 451 | { 452 | "type": "text", 453 | "value": "make", 454 | "ts": 16.05, 455 | "end_ts": 16.23, 456 | "confidence": 1 457 | }, 458 | { 459 | "type": "punct", 460 | "value": " " 461 | }, 462 | { 463 | "type": "text", 464 | "value": "the", 465 | "ts": 16.23, 466 | "end_ts": 16.29, 467 | "confidence": 1 468 | }, 469 | { 470 | "type": "punct", 471 | "value": " " 472 | }, 473 | { 474 | "type": "text", 475 | "value": "speech", 476 | "ts": 16.29, 477 | "end_ts": 16.71, 478 | "confidence": 1 479 | }, 480 | { 481 | "type": "punct", 482 | "value": " " 483 | }, 484 | { 485 | "type": "text", 486 | "value": "to", 487 | "ts": 16.71, 488 | "end_ts": 16.83, 489 | "confidence": 1 490 | }, 491 | { 492 | "type": "punct", 493 | "value": " " 494 | }, 495 | { 496 | "type": "text", 497 | "value": "text", 498 | "ts": 16.83, 499 | "end_ts": 17.16, 500 | "confidence": 1 501 | }, 502 | { 503 | "type": "punct", 504 | "value": " " 505 | }, 506 | { 507 | "type": "text", 508 | "value": "process", 509 | "ts": 17.16, 510 | "end_ts": 17.61, 511 | "confidence": 1 512 | }, 513 | { 514 | "type": "punct", 515 | "value": " " 516 | }, 517 | { 518 | "type": "text", 519 | "value": "quicker", 520 | "ts": 17.64, 521 | "end_ts": 18.15, 522 | "confidence": 1 523 | }, 524 | { 525 | "type": "punct", 526 | "value": "," 527 | }, 528 | { 529 | "type": "punct", 530 | "value": " " 531 | }, 532 | { 533 | "type": "text", 534 | "value": "cheaper", 535 | "ts": 18.42, 536 | "end_ts": 19.02, 537 | "confidence": 1 538 | }, 539 | { 540 | "type": "punct", 541 | "value": "," 542 | }, 543 | { 544 | "type": "punct", 545 | "value": " " 546 | }, 547 | { 548 | "type": "text", 549 | "value": "and", 550 | "ts": 19.26, 551 | "end_ts": 19.38, 552 | "confidence": 1 553 | }, 554 | { 555 | "type": "punct", 556 | "value": " " 557 | }, 558 | { 559 | "type": "text", 560 | "value": "a", 561 | "ts": 19.38, 562 | "end_ts": 19.44, 563 | "confidence": 1 564 | }, 565 | { 566 | "type": "punct", 567 | "value": " " 568 | }, 569 | { 570 | "type": "text", 571 | "value": "bit", 572 | "ts": 19.44, 573 | "end_ts": 19.62, 574 | "confidence": 1 575 | }, 576 | { 577 | "type": "punct", 578 | "value": " " 579 | }, 580 | { 581 | "type": "text", 582 | "value": "more", 583 | "ts": 19.62, 584 | "end_ts": 19.8, 585 | "confidence": 1 586 | }, 587 | { 588 | "type": "punct", 589 | "value": " " 590 | }, 591 | { 592 | "type": "text", 593 | "value": "enjoyable", 594 | "ts": 19.8, 595 | "end_ts": 20.31, 596 | "confidence": 1 597 | }, 598 | { 599 | "type": "punct", 600 | "value": "." 601 | } 602 | ] 603 | } 604 | ] 605 | } -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlum/scription/ba11ddb646b64d1d1233cca078e22037ea02521a/favicon.ico -------------------------------------------------------------------------------- /images/audacity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlum/scription/ba11ddb646b64d1d1233cca078e22037ea02521a/images/audacity.png -------------------------------------------------------------------------------- /images/scription-logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/scription-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smlum/scription/ba11ddb646b64d1d1233cca078e22037ea02521a/images/scription-screenshot.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Scription — Automate speech transcription 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 271 | 272 | 273 |
274 | 275 | 277 | 278 |
279 |
280 |
281 |
282 | 283 | 284 | 285 | 286 | 288 | 289 |
290 | 291 | 292 |
293 | 298 |
299 | 300 | 301 | 305 | 306 |
307 |
308 |
309 |
310 | 312 | 313 |
314 | 316 | 317 |
318 |
319 |
320 |
321 | 323 | 324 | 325 |
326 |
327 | 329 | 330 | 331 |
332 |
333 |
334 |
335 | 336 | 337 | 338 | 341 | 342 | 343 | 344 | 345 | 346 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 356 | 357 | 358 | 359 | 361 | 362 | 363 |
364 | 365 |
366 |
367 | 368 |
370 |
371 | 372 |
373 |

spk_1 [0:00] transcription body combines the brute force of automated transcription with an interactive editor. It links text audio playback, making it easier to scan through a transcript to fix any errors and extract useful information.

407 |

spk_1 [0:14] The objective is to make this speech to 415 | text process quicker, cheaper, on a bit more enjoyable. 423 |

424 |

spk_1 [0:20]

426 |
427 | 428 |
429 |
430 |
431 | 432 |
433 | 434 |
435 | 436 | 437 | 438 | 439 |
440 |
441 |
442 | 443 | 444 |

Annotations

445 | 446 |
447 | 448 | Category 449 | 1 450 | 451 | 452 | 453 | 454 | 455 | 456 |
457 |
458 |
459 |

Annotations:

460 |
461 |
462 |
463 |
464 | 465 | Category 466 | 2 467 | 468 | 469 | 470 | 471 | 472 | 473 |
474 |
475 |
476 |

Annotations:

477 |
478 |
479 |
480 |
481 | 482 | Category 3 484 | 485 | 486 | 487 | 488 | 489 | 490 |
491 |
492 |
493 |

Annotations:

494 |
495 |
496 |
497 |
498 | 499 | Category 4 501 | 502 | 503 | 504 | 505 | 506 | 507 |
508 |
509 |
510 |

Annotations:

511 |
512 |
513 |
514 |
515 | 516 | Category 5 518 | 519 | 520 | 521 | 522 | 523 | 524 |
525 |
526 |
527 |

Annotations:

528 |
529 |
530 |
531 |
532 | 533 | Category 6 535 | 536 | 537 | 538 | 539 | 540 | 541 |
542 |
543 |
544 |

Annotations:

545 |
546 |
547 |
548 |
549 | 550 | Category 7 552 | 553 | 554 | 555 | 556 | 557 | 558 |
559 |
560 |
561 |

Annotations:

562 |
563 |
564 |
565 | 566 | 567 | 568 | 569 |
570 | 575 | 576 |
577 |
578 |
579 |
580 | 581 |
582 |
583 | 584 |
585 |
586 |
587 | 588 | 589 |
590 |
591 | 592 |
593 | 594 | 595 | 596 | 597 | 598 | 599 | 605 | 606 | 607 | 617 | 618 | 619 | 635 | 636 | 722 | 723 | 724 | 725 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | -------------------------------------------------------------------------------- /javascript/bulma.js: -------------------------------------------------------------------------------- 1 | 2 | // accordian 3 | var acc = document.getElementsByClassName("accordion"); 4 | var accDown = document.getElementsByClassName("accordion-down"); 5 | var i; 6 | 7 | for (i = 0; i < accDown.length; i++) { 8 | accDown[i].addEventListener("click", function () { 9 | this.parentElement.classList.toggle("active-accordion"); 10 | var panel = this.parentElement.nextElementSibling; 11 | if (panel.style.display === "block") { 12 | panel.style.display = "none"; 13 | } else { 14 | panel.style.display = "block"; 15 | } 16 | }); 17 | } 18 | 19 | 20 | // function load() { 21 | // const hi = "hi" 22 | 23 | // const data = { 24 | // hi 25 | // }; 26 | // const options = { 27 | // method: 'POST', 28 | // headers: { 29 | // 'Content-Type': 'application/json' 30 | // }, 31 | // body: JSON.stringify(data) 32 | // }; 33 | // // fetch('/api', options).then(response => { 34 | // // console.log(response.json()); 35 | // // }) 36 | 37 | // let response = fetch('/api', options); 38 | // const dat = response.json(); 39 | // console.log(dat); 40 | // } 41 | 42 | 43 | // add back in if using modal button 44 | 45 | // document.querySelector('#modal-button').addEventListener('click', function (event) { 46 | // event.preventDefault(); 47 | // var modal = document.querySelector('.modal'); // assuming you have only 1 48 | // var html = document.querySelector('html'); 49 | // modal.classList.add('is-active'); 50 | // html.classList.add('is-clipped'); 51 | 52 | // modal.querySelector('.modal-background').addEventListener('click', function (e) { 53 | // e.preventDefault(); 54 | // modal.classList.remove('is-active'); 55 | // html.classList.remove('is-clipped'); 56 | // }); 57 | // }); 58 | 59 | -------------------------------------------------------------------------------- /javascript/dark-mode-footer.js: -------------------------------------------------------------------------------- 1 | // can this be added to dark-mode.js 2 | 3 | 4 | // identify the toggle switch HTML element 5 | // const toggleSwitch = document.querySelector('#dark-mode-switch input[type="checkbox"]'); 6 | const toggleSwitch = document.getElementById('dark-mode-switch'); 7 | 8 | // const toggleSwitch = $('#dark-mode-switch'); 9 | 10 | //function that changes the theme, and sets a localStorage variable to track the theme between page loads 11 | function switchTheme(e) { 12 | if (e.target.checked) { 13 | localStorage.setItem('theme', 'dark'); 14 | document.documentElement.setAttribute('data-theme', 'dark'); 15 | toggleSwitch.checked = true; 16 | console.log('dark mode set'); 17 | } else { 18 | localStorage.setItem('theme', 'light'); 19 | document.documentElement.setAttribute('data-theme', 'light'); 20 | toggleSwitch.checked = false; 21 | console.log('light mode set'); 22 | } 23 | } 24 | 25 | //listener for changing themes 26 | toggleSwitch.addEventListener('change', switchTheme, false); 27 | 28 | //pre-check the dark-theme checkbox if dark-theme is set 29 | if (document.documentElement.getAttribute("data-theme") == "dark"){ 30 | toggleSwitch.checked = true; 31 | } -------------------------------------------------------------------------------- /javascript/dark-mode.js: -------------------------------------------------------------------------------- 1 | // include in the header of the html before body 2 | 3 | //determines if the user has a set theme 4 | function detectColorScheme(){ 5 | var theme="light"; //default to light 6 | 7 | //local storage is used to override OS theme settings 8 | if(localStorage.getItem("theme")){ 9 | if(localStorage.getItem("theme") == "dark"){ 10 | console.log('dark mode from storage'); 11 | var theme = "dark"; 12 | } 13 | } else if(!window.matchMedia) { 14 | //matchMedia method not supported 15 | return false; 16 | } else if(window.matchMedia("(prefers-color-scheme: dark)").matches) { 17 | //OS theme setting detected as dark 18 | console.log('dark theme detected from system'); 19 | var theme = "dark"; 20 | } 21 | 22 | //dark theme preferred, set document with a `data-theme` attribute 23 | if (theme=="dark") { 24 | document.documentElement.setAttribute("data-theme", "dark"); 25 | } 26 | } 27 | detectColorScheme(); 28 | -------------------------------------------------------------------------------- /javascript/editor.js: -------------------------------------------------------------------------------- 1 | // adds aditing functionality such as click highlighting and keyboard shortcuts to control audio 2 | 3 | // creates an array of all annotated text 4 | // ultimately, want to break them down by catogory. a column per category 5 | 6 | 7 | 8 | // create array of annotations to be exported 9 | function getAnnotations() { 10 | numberOfCategories = 7 + 1; 11 | 12 | 13 | // this would make an n*m matrics 14 | // var matrix = []; 15 | // for(var i=0; i<7; i++) { 16 | // matrix[i] = []; 17 | // for(var j=0; j<9; j++) { 18 | // matrix[i][j] = ','; 19 | // } 20 | // } 21 | 22 | // create the array from category names and contents 23 | var annotationsArray = [] 24 | for (let i = 1; i < numberOfCategories; i++) { 25 | getCategory = '.category-' + i; 26 | categoryName = $(getCategory).html(); 27 | // populate the list from the transcript 28 | var items = document.getElementsByClassName('selected-' + i); 29 | // var items = document.getElementsByClassName(categoryName); 30 | //var array = [categoryName] 31 | // put just the inner text in a new array 32 | for (let j = 0; j < items.length; j++) { 33 | time = 0; 34 | 35 | if (items[j].parentElement && items[j].parentElement.attributes["data-time"]){ 36 | time = Math.round(items[j].parentElement.attributes["data-time"].value); 37 | tc = items[j].parentElement.attributes["data-tc"].value; 38 | } 39 | annotationsArray.push([categoryName,time,tc, items[j].innerText]); 40 | } 41 | } 42 | 43 | return annotationsArray; 44 | } 45 | 46 | // export to csv on button click 47 | // set category name as filename, set data to rows 48 | function exportToCsv() { 49 | 50 | filename = "test.csv"; 51 | // define rows from annotations 52 | rows = getAnnotations() 53 | 54 | var processRow = function (row) { 55 | var finalVal = ''; 56 | for (var j = 0; j < row.length; j++) { 57 | var innerValue = row[j] === null ? '' : row[j].toString(); 58 | if (row[j] instanceof Date) { 59 | innerValue = row[j].toLocaleString(); 60 | }; 61 | var result = innerValue.replace(/"/g, '""'); 62 | if (result.search(/("|,|\n)/g) >= 0) 63 | result = '"' + result + '"'; 64 | if (j > 0) 65 | finalVal += ','; 66 | finalVal += result; 67 | } 68 | return finalVal + '\n'; 69 | }; 70 | 71 | let csvFile = 'Category,Time(sec),Time(mm:ss),Text' + '\n'; 72 | for (var i = 0; i < rows.length; i++) { 73 | csvFile += processRow(rows[i]); 74 | } 75 | 76 | 77 | var blob = new Blob([csvFile], { type: 'text/csv;charset=utf-8;' }); 78 | if (navigator.msSaveBlob) { // IE 10+ 79 | navigator.msSaveBlob(blob, filename); 80 | } else { 81 | var link = document.createElement("a"); 82 | if (link.download !== undefined) { // feature detection 83 | // Browsers that support HTML5 download attribute 84 | var url = URL.createObjectURL(blob); 85 | link.setAttribute("href", url); 86 | link.setAttribute("download", filename); 87 | link.style.visibility = 'hidden'; 88 | document.body.appendChild(link); 89 | link.click(); 90 | document.body.removeChild(link); 91 | } 92 | } 93 | } 94 | 95 | $(document).ready(function () { 96 | 97 | new GreenAudioPlayer('.gap-example'); 98 | 99 | // load audio 100 | var myAudio = document.getElementById("hyperplayer"); 101 | var isPlaying = false; 102 | var playbackRate = 1.0; 103 | 104 | // select and highlight the clicked word (ready to be edited) 105 | // checks if the element clicked has a data confidence value, which implies it's a word 106 | $('#content').on("click", "span", function () { 107 | var range, selection; 108 | if (window.getSelection) { 109 | selection = window.getSelection(); 110 | range = document.createRange(); 111 | range.selectNodeContents(this); 112 | selection.removeAllRanges(); 113 | selection.addRange(range); 114 | } else if (document.body.createTextRange) { 115 | range = document.body.createTextRange(); 116 | range.moveToElementText(this); 117 | range.select(); 118 | } 119 | }); 120 | 121 | 122 | 123 | // Add keybaord shortcuts 124 | 125 | // toggle play and pause 126 | function togglePlay() { 127 | if (isPlaying) { 128 | myAudio.pause(); 129 | } else { 130 | myAudio.play(); 131 | }; 132 | }; 133 | myAudio.onplaying = function () { 134 | isPlaying = true; 135 | }; 136 | myAudio.onpause = function () { 137 | isPlaying = false; 138 | }; 139 | 140 | document.addEventListener('keydown', function (e) { 141 | // play and pause audio 142 | if (e.ctrlKey && e.keyCode == 32 && !(e.shiftKey)) { 143 | togglePlay() 144 | }; 145 | // stop audio (ctrl + space) 146 | if (e.ctrlKey && e.shiftKey && e.keyCode == 32) { 147 | myAudio.load(); 148 | isPlaying = false; 149 | }; 150 | // speed up audio (ctrl + shift + >) 151 | if (e.ctrlKey && e.shiftKey && e.keyCode == 190) { 152 | if (playbackRate < 3.0) { 153 | playbackRate = playbackRate + 0.25; 154 | }; 155 | myAudio.playbackRate = playbackRate; 156 | console.log('playback rate: ' + playbackRate); 157 | 158 | }; 159 | // slow down audio (ctrl + shift + <) 160 | if (e.ctrlKey && e.shiftKey && e.keyCode == 188) { 161 | if (playbackRate > 0.25) { 162 | playbackRate = playbackRate - 0.25; 163 | }; 164 | myAudio.playbackRate = playbackRate; 165 | console.log('playback rate: ' + playbackRate); 166 | }; 167 | // skip forward 5 seconds (ctrl + >) 168 | if (e.ctrlKey && e.keyCode == 190 && !(e.shiftKey)) { 169 | myAudio.currentTime += 5.0; 170 | }; 171 | // skip back 5 seconds (ctrl + <) 172 | if (e.ctrlKey && e.keyCode == 188 && !(e.shiftKey)) { 173 | myAudio.currentTime -= 5.0; 174 | }; 175 | }); 176 | 177 | 178 | 179 | }); 180 | 181 | var displayConfidenceToggle = false 182 | 183 | 184 | 185 | // $('#confidence').prop('checked', false); 186 | 187 | $('#confidence').change(function () { 188 | // store the value of the checkbox when it's changed 189 | var confidenceCheckbox = document.getElementById("confidence").checked; 190 | window.localStorage.setItem("autoscroll-off", confidenceCheckbox); 191 | console.log("new confidence checkbox value:" + confidenceCheckbox); 192 | // if (confidenceCheckbox == true) { 193 | displayConfidence() 194 | // } 195 | }); 196 | 197 | // highlight low confidence words 198 | 199 | function displayConfidence() { 200 | 201 | if (displayConfidenceToggle == false) { 202 | var userConfidence = $("#user-confidence").val() 203 | var userConfidence = 0.95; 204 | console.log(userConfidence); 205 | $("span").filter(function() { 206 | return $(this).data("confidence") < userConfidence; 207 | }).addClass("low-confidence") 208 | displayConfidenceToggle = true 209 | } else if (displayConfidenceToggle == true) { 210 | $(".low-confidence").removeClass("low-confidence"); 211 | console.log('removed'); 212 | 213 | displayConfidenceToggle = false; 214 | } 215 | 216 | } 217 | // display confidence by default for demo 218 | displayConfidence() 219 | 220 | // turn off the interactivity and return text color 221 | // TODO this is not a smart way of doing this! 222 | 223 | var autoscrollOffToggle = false; 224 | 225 | function autoscrollOff() { 226 | 227 | 228 | if (autoscrollOffToggle == false) { 229 | // to beat the javascript altering the color each span had to be selected 230 | $("[data-m]").addClass("not-interactive") 231 | $(".timecode").addClass("not-interactive") 232 | autoscrollOffToggle = true 233 | console.log('interactive transcript off'); 234 | hyper(false); 235 | } else if (autoscrollOffToggle == true) { 236 | $(".not-interactive").removeClass("not-interactive"); 237 | 238 | autoscrollOffToggle = false; 239 | } 240 | 241 | } 242 | -------------------------------------------------------------------------------- /javascript/hyperaudio-lite.js: -------------------------------------------------------------------------------- 1 | var hyperaudiolite = (function() { 2 | var hal = {}, 3 | transcript, 4 | words, 5 | player, 6 | paraIndex, 7 | start, 8 | end; 9 | 10 | function getParameter(name) { 11 | name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); 12 | var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), 13 | results = regex.exec(location.search); 14 | return results === null 15 | ? '' 16 | : decodeURIComponent(results[1].replace(/\+/g, ' ')); 17 | } 18 | 19 | function init(mediaElementId) { 20 | words = transcript.getElementsByTagName('span'); 21 | paras = transcript.getElementsByTagName('p'); 22 | player = document.getElementById(mediaElementId); 23 | paraIndex = 0; 24 | words[0].classList.add('active'); 25 | paras[0].classList.add('active'); 26 | transcript.addEventListener('click', setPlayHead, false); 27 | player.addEventListener('timeupdate', checkPlayHead, false); 28 | 29 | //check for queryString params 30 | 31 | start = getParameter('s'); 32 | 33 | if (!isNaN(parseFloat(start))) { 34 | player.currentTime = start / 10; 35 | // player.play(); 36 | } 37 | 38 | end = parseFloat(getParameter('d')) + parseFloat(start); 39 | } 40 | 41 | function setPlayHead(e) { 42 | var target = e.target ? e.target : e.srcElement; 43 | target.classList.add('active'); 44 | var timeSecs = parseInt(target.getAttribute('data-m')) / 1000; 45 | 46 | if (!isNaN(parseFloat(timeSecs))) { 47 | end = null; 48 | player.currentTime = timeSecs; 49 | // uncomment if you want audio to play when word is clicked 50 | // player.play(); 51 | } 52 | } 53 | 54 | function checkPlayHead(e) { 55 | //check for end time of shared piece 56 | 57 | if (end && end / 10 < player.currentTime) { 58 | player.pause(); 59 | end = null; 60 | } 61 | 62 | var activeitems = transcript.getElementsByClassName('active'); 63 | var activeitemsLength = activeitems.length; 64 | 65 | for (var a = 0; a < activeitemsLength; a++) { 66 | if (activeitems[a]) { 67 | // TODO: look into why we need this 68 | activeitems[a].classList.remove('active'); 69 | } 70 | } 71 | 72 | // Establish current paragraph index 73 | 74 | var currentParaIndex; 75 | 76 | for (i = 1; i < words.length; i++) { 77 | if ( 78 | parseInt(words[i].getAttribute('data-m')) / 1000 > 79 | player.currentTime 80 | ) { 81 | // TODO: look for a better way of doing this 82 | var strayActive = transcript.getElementsByClassName('active')[0]; 83 | //fix undefined state error 84 | if (strayActive){ 85 | strayActive.classList.remove('active'); 86 | } 87 | 88 | // word time is in the future - set the previous word as active. 89 | words[i - 1].classList.add('active'); 90 | words[i - 1].parentNode.classList.add('active'); 91 | 92 | paras = transcript.getElementsByTagName('p'); 93 | 94 | for (a = 0; a < paras.length; a++) { 95 | if (paras[a].classList.contains('active')) { 96 | currentParaIndex = a; 97 | break; 98 | } 99 | } 100 | 101 | if (currentParaIndex != paraIndex) { 102 | Velocity(words[i].parentNode, 'scroll', { 103 | container: hypertranscript, 104 | duration: 800, 105 | delay: 0, 106 | }); 107 | 108 | paraIndex = currentParaIndex; 109 | } 110 | 111 | break; 112 | } 113 | } 114 | } 115 | 116 | hal.init = function(transcriptId, mediaElementId) { 117 | transcript = document.getElementById(transcriptId); 118 | init(mediaElementId); 119 | }; 120 | 121 | hal.loadTranscript = function(url) { 122 | var xmlhttp; 123 | 124 | if (window.XMLHttpRequest) { 125 | // code for IE7+, Firefox, Chrome, Opera, Safari 126 | xmlhttp = new XMLHttpRequest(); 127 | } else { 128 | // code for IE6, IE5 129 | xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); 130 | } 131 | 132 | xmlhttp.onreadystatechange = function() { 133 | if (xmlhttp.readyState == 4) { 134 | if (xmlhttp.status == 200) { 135 | transcript = document.getElementById('hypertranscript'); 136 | transcript.innerHTML = xmlhttp.responseText; 137 | init(); 138 | } else if (xmlhttp.status == 400) { 139 | alert('There was an error 400'); 140 | } else { 141 | alert('something else other than 200 was returned'); 142 | } 143 | } 144 | }; 145 | 146 | xmlhttp.open('GET', url, true); 147 | xmlhttp.send(); 148 | }; 149 | 150 | return hal; 151 | })(); 152 | -------------------------------------------------------------------------------- /javascript/save.js: -------------------------------------------------------------------------------- 1 | // script to autosave to local storage 2 | 3 | 4 | 5 | // export transcrpt 6 | // function exportToTxt() { 7 | // console.log('saving'); 8 | // var blob = new Blob(["Welcome to Websparrow.org."], 9 | // { type: "text/plain;charset=utf-8" }); 10 | // saveAs(blob, "static.txt"); 11 | // } 12 | 13 | // function exportToTxt() { 14 | // var content = "bla" 15 | // var fileName = "blo.txt" 16 | // var contentType = "text/plain;charset=utf-8" 17 | // var a = document.createElement("a"); 18 | // var file = new Blob([content], {type: contentType}); 19 | // a.href = URL.createObjectURL(file); 20 | // a.downloadd = fileName; 21 | // a.click(); 22 | // } 23 | // downloadd(jsonData, 'json.txt', 'text/plain'); 24 | 25 | // export just text to file 26 | function exportToTxt() { 27 | var filename = "transcript.txt"; 28 | // var text = document.getElementById("content").innerHTML; 29 | var items = document.getElementById("content").getElementsByClassName('content'); 30 | var text = ''; 31 | //export transcript pretty print TODO add speakers 32 | for (i = 0; i < items.length; i++) { 33 | text += items[i].getAttribute('data-tc') + ' ' + items[i].innerText + '\n\n'; 34 | } 35 | var element = document.createElement('a'); 36 | element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); 37 | element.setAttribute('download', filename); 38 | 39 | element.style.display = 'none'; 40 | document.body.appendChild(element); 41 | 42 | element.click(); 43 | 44 | document.body.removeChild(element); 45 | } 46 | 47 | // export raw html to file - can late be reloaded 48 | function exportToHtml() { 49 | var userFilename = $('#save-html-name').val(); 50 | 51 | var filename = userFilename; 52 | console.log('saving: ' + filename); 53 | var text = document.getElementById("content").innerHTML; 54 | var element = document.createElement('a'); 55 | element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); 56 | element.setAttribute('download', filename); 57 | 58 | element.style.display = 'none'; 59 | document.body.appendChild(element); 60 | 61 | element.click(); 62 | 63 | document.body.removeChild(element); 64 | } 65 | 66 | 67 | // TODO: stop javascript running when page not active 68 | 69 | // check for idleness every 10 seconds 70 | // idle if no mouse or key events for 20 seconds 71 | var idleTime = 0; 72 | $(document).ready(function () { 73 | 74 | // save configuration as cookies 75 | 76 | // save autosave configuration 77 | $('#autosave').change(function () { 78 | // store the value of the checkbox when it's changed 79 | var autosaveCheckbox = document.getElementById("autosave").checked; 80 | window.localStorage.setItem("autosave-check", autosaveCheckbox); 81 | console.log("new saved value:" + autosaveCheckbox); 82 | if (autosaveCheckbox == true) { 83 | startTimer(); 84 | } 85 | }); 86 | 87 | $('#autoscroll-off').change(function () { 88 | // store the value of the checkbox when it's changed 89 | var autoscrollCheckbox = document.getElementById("autoscroll-off").checked; 90 | window.localStorage.setItem("autoscroll-off", autoscrollCheckbox); 91 | console.log("new autoscroll value:" + autoscrollCheckbox); 92 | if (autoscrollCheckbox == true) { 93 | hyper() 94 | } 95 | autoscrollOff(); 96 | }); 97 | 98 | // realise better to do this was to add an if condition on the function 99 | $('#annotation-switch').change(function () { 100 | // 101 | var annotaionCheckbox = document.getElementById("annotation-switch").checked; 102 | if (annotaionCheckbox == true) { 103 | $(".selected").css({"backgroundColor": ""}); 104 | // $(".drop-element").css({'cssText': 'display: none !important'}); 105 | console.log("annotations on"); 106 | } else { 107 | $(".selected").css({"backgroundColor": "transparent"}); 108 | // $(".drop-element").css({'cssText': 'display: block !important'}); 109 | console.log("annotations off"); 110 | } 111 | 112 | // $('.selected').css("background-color") = "transparent !important"; 113 | }); 114 | 115 | 116 | // $('#dark-mode-switch').change(function () { 117 | // // store the value of the checkbox when it's changed 118 | // var darkModeCheck = document.getElementById("dark-mode-switch").checked; 119 | // window.localStorage.setItem("dark-mode-switch", darkModeCheck); 120 | // console.log("new darkmode value:" + darkModeCheck); 121 | // }); 122 | 123 | 124 | 125 | 126 | //Increment the idle time counter every minute. 127 | 128 | }); 129 | 130 | function startTimer() { 131 | var idleInterval = setInterval(timerIncrement, 2000); // 10 seconds 132 | //Zero the idle timer on mouse movement. 133 | $(this).mousemove(function (e) { 134 | idleTime = 0; 135 | }); 136 | $(this).keypress(function (e) { 137 | idleTime = 0; 138 | }); 139 | } 140 | 141 | // call autosave function if not idle 142 | function timerIncrement() { 143 | idleTime++; 144 | if (idleTime > 2) { // idle after 20 seconds 145 | // console.log("idle"); 146 | } else { 147 | autosave() 148 | } 149 | } 150 | 151 | 152 | 153 | // save content to local storage 154 | function autosave() { 155 | 156 | 157 | // save transcript text 158 | var textToSave = document.getElementById("content").innerHTML; 159 | window.localStorage.setItem("saved-text", textToSave); 160 | // save input box text - turned off 161 | // var audioUrlToSave = document.getElementById("audioUrl").value; 162 | // window.localStorage.setItem("saved-audio-url", audioUrlToSave); 163 | // var jsonUrlToSave = document.getElementById("user-filename").value; 164 | // window.localStorage.setItem("saved-transcript-filename", jsonUrlToSave); 165 | // console.log("saved"); 166 | 167 | // save annotation sidebar contents 168 | // var annotationsToSave = document.getElementsByClassName("annotation-content-1").innerHTML; 169 | var annotationsToSave = $('.annotation-content-1').html(); 170 | window.localStorage.setItem("saved-annotation-1", annotationsToSave); 171 | 172 | // save category titles (dumb) 173 | var annotationTitle = $('.category-1').html(); 174 | window.localStorage.setItem("saved-category-1", annotationTitle); 175 | var annotationTitle = $('.category-2').html(); 176 | window.localStorage.setItem("saved-category-2", annotationTitle); 177 | var annotationTitle = $('.category-3').html(); 178 | window.localStorage.setItem("saved-category-3", annotationTitle); 179 | var annotationTitle = $('.category-4').html(); 180 | window.localStorage.setItem("saved-category-4", annotationTitle); 181 | var annotationTitle = $('.category-5').html(); 182 | window.localStorage.setItem("saved-category-5", annotationTitle); 183 | var annotationTitle = $('.category-6').html(); 184 | window.localStorage.setItem("saved-category-6", annotationTitle); 185 | var annotationTitle = $('.category-7').html(); 186 | window.localStorage.setItem("saved-category-7", annotationTitle); 187 | 188 | 189 | 190 | }; 191 | 192 | 193 | 194 | // load previously saved data 195 | function loadSavedText() { 196 | 197 | if (typeof (Storage) !== "undefined") { 198 | 199 | // check if the set value for the checkbox is true 200 | // if it's true, then set the checkbox value to true 201 | 202 | if (localStorage.getItem("autosave-check")) { 203 | var previousCheck = localStorage.getItem("autosave-check") 204 | 205 | // if no autosave, then load the transcript 206 | // if autosave turned on then load the stored data 207 | if (previousCheck == "false") { 208 | console.log("no autosave"); 209 | document.getElementById("autosave").checked = false; 210 | // uncomment for automatic display 211 | // displayTranscript() 212 | } else if (previousCheck == "true") { 213 | console.log("autosave enabled"); 214 | document.getElementById("autosave").checked = true; 215 | startTimer(); 216 | 217 | if (localStorage.getItem("saved-text")) { 218 | var storedText = localStorage.getItem("saved-text"); 219 | console.log("saved data found"); 220 | document.getElementById("content").innerHTML = document.getElementById("content").innerHTML + storedText; 221 | } 222 | // TODO save more for each one 223 | if (localStorage.getItem("saved-annotation-1")) { 224 | var storedAnnotation = localStorage.getItem("saved-annotation-1"); 225 | $('.annotation-content-1').html(storedAnnotation); 226 | } 227 | 228 | // load category names (dumb) 229 | if (localStorage.getItem("saved-category-1")) { 230 | 231 | var storedCategory = localStorage.getItem("saved-category-1"); 232 | $('.category-1').html(storedCategory); 233 | } 234 | if (localStorage.getItem("saved-category-2")) { 235 | 236 | var storedCategory = localStorage.getItem("saved-category-2"); 237 | $('.category-2').html(storedCategory); 238 | } 239 | if (localStorage.getItem("saved-category-3")) { 240 | 241 | var storedCategory = localStorage.getItem("saved-category-3"); 242 | $('.category-3').html(storedCategory); 243 | } 244 | if (localStorage.getItem("saved-category-4")) { 245 | 246 | var storedCategory = localStorage.getItem("saved-category-4"); 247 | $('.category-4').html(storedCategory); 248 | } 249 | if (localStorage.getItem("saved-category-5")) { 250 | 251 | var storedCategory = localStorage.getItem("saved-category-5"); 252 | $('.category-5').html(storedCategory); 253 | } 254 | if (localStorage.getItem("saved-category-6")) { 255 | 256 | var storedCategory = localStorage.getItem("saved-category-6"); 257 | $('.category-6').html(storedCategory); 258 | } 259 | if (localStorage.getItem("saved-category-7")) { 260 | 261 | var storedCategory = localStorage.getItem("saved-category-7"); 262 | $('.category-7').html(storedCategory); 263 | } 264 | 265 | 266 | 267 | // load dark mode from cookie, else detect it from user computer 268 | // if (localStorage.getItem("dark-mode-switch") != undefined) { 269 | // var storedDarkMode = localStorage.getItem("dark-mode-switch") 270 | // // note that stored data is a string not a Boolean 271 | // if (storedDarkMode == "true") { 272 | // $('#dark-mode-switch').prop('checked', true); 273 | // } else { 274 | // $('#dark-mode-switch').prop('checked', false); 275 | // } 276 | // } else { 277 | // if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { 278 | // // dark mode 279 | // console.log('dark mode detected from system'); 280 | // $('#dark-mode-switch').prop('checked', true); 281 | // } else { 282 | // console.log('light mode detected from system'); 283 | // $('#dark-mode-switch').prop('checked', false); 284 | // } 285 | // } 286 | // if (localStorage.getItem("saved-audio-url")) { 287 | // var storedAudioUrl = localStorage.getItem("saved-audio-url") 288 | // document.getElementById("audioUrl").value = storedAudioUrl; 289 | // } 290 | // if (localStorage.getItem("saved-transcript-filename")) { 291 | // var storedJsonUrl = localStorage.getItem("saved-transcript-filename") 292 | // document.getElementById("user-filename").value = storedJsonUrl; 293 | // } 294 | 295 | } 296 | } 297 | } else { 298 | //document.getElementById("result").innerHTML = "Sorry, autosave didn't work :'("; 299 | } 300 | } 301 | $(document).ready(function () { 302 | loadSavedText(); 303 | 304 | }) 305 | -------------------------------------------------------------------------------- /javascript/tooltip.js: -------------------------------------------------------------------------------- 1 | var selection = ''; 2 | var params = ''; 3 | var drop; 4 | var selectedText; 5 | 6 | function highlight(element) { 7 | if(element) { 8 | $(element).addClass("highlightt"); 9 | setTimeout(function () { 10 | $(element).removeClass('highlightt'); 11 | }, 3000); 12 | } 13 | } 14 | 15 | 16 | $(document).click(function(event) { 17 | $target = $(event.target); 18 | if(!$target.closest('#tweet-box').length && 19 | $('#tweet-box').is(":visible")) { 20 | // $('#menucontainer').hide(); 21 | closeDrop(); 22 | } 23 | }); 24 | 25 | 26 | // twttr.widgets.load(); 27 | 28 | var contentss = $('.category-1').html(); 29 | $('.category-1').blur(function () { 30 | if (contentss != $(this).html()) { 31 | contentss = $(this).html(); 32 | } 33 | }); 34 | 35 | // this function is activated on mouseup after user has highlighted text 36 | function addShareTool(a, previousSelection) { 37 | // if annotation mode on 38 | var annotaionCheckbox = document.getElementById("annotation-switch").checked; 39 | if (annotaionCheckbox) { 40 | if (window.getSelection) { 41 | selection = window.getSelection(); 42 | 43 | } else if (document.selection) { 44 | selection = document.selection.createRange(); 45 | } 46 | 47 | if (selection.toString() !== '') { 48 | if (drop) { 49 | drop.close(); 50 | drop.remove(); 51 | drop = null; 52 | } 53 | 54 | anchorNode = selection.anchorNode.parentNode; 55 | focusNode = selection.focusNode.parentNode; 56 | 57 | var anchorNodeTime = parseInt(anchorNode.getAttribute('data-m'), 10); 58 | var anchorNodeDuration = parseInt(anchorNode.getAttribute('data-d'), 10); 59 | var focusNodeTime = parseInt(focusNode.getAttribute('data-m'), 10); 60 | var focusNodeDuration = parseInt(focusNode.getAttribute('data-d'), 10); 61 | 62 | // 1/10 of a second accuracy is fine for our needs 63 | 64 | anchorNodeTime = Math.floor(anchorNodeTime / 100); 65 | anchorNodeDuration = Math.floor(anchorNodeDuration / 100); 66 | focusNodeTime = Math.floor(focusNodeTime / 100); 67 | focusNodeDuration = Math.floor(focusNodeDuration / 100); 68 | 69 | if (anchorNodeTime < focusNodeTime) { 70 | params = 71 | '?s=' + 72 | anchorNodeTime + 73 | '&d=' + 74 | (focusNodeTime + focusNodeDuration - anchorNodeTime); 75 | } else { 76 | params = 77 | '?s=' + 78 | focusNodeTime + 79 | '&d=' + 80 | (anchorNodeTime + anchorNodeDuration - focusNodeTime); 81 | } 82 | 83 | drop = new Drop({ 84 | target: anchorNode, 85 | classes: 'drop-theme-basic', 86 | position: 'top center', 87 | constrainToWindow: true, 88 | constrainToScrollParent: true, 89 | openOn: 'always', 90 | content: '
', 91 | }); 92 | 93 | drop.on('open', fillShare, false); 94 | 95 | /**/ 96 | } 97 | } 98 | 99 | 100 | } 101 | 102 | function fillShare() { 103 | // think can get rid of some of this function, since some of it was used to generate the tweet 104 | 105 | var url = window.location.href; 106 | var lastCharPos = url.length - 1; 107 | 108 | if (url.charAt(lastCharPos) == '/') { 109 | // URL ends with a '/' 110 | url = url.substr(0, lastCharPos); 111 | } 112 | 113 | var shareText = selection + ' ' + url + params; 114 | 115 | selectedText = selection; 116 | 117 | var overspill = shareText.length - 140; 118 | 119 | selection += ''; 120 | 121 | if (selection.charAt(0) == ' ') { 122 | // trim leading whitespace 123 | selection = selection.substring(1, selection.length); 124 | } 125 | 126 | if (overspill > 0) { 127 | selection = selection.substr(0, selection.length - overspill - 5) + '...'; //3 dots + 2 quotes make 5 chars (subtract 5) 128 | } 129 | 130 | selection = '"' + selection + '"'; 131 | 132 | // document.getElementById('tweet-box').innerHTML = 133 | // '

text+video
'; 139 | // drop.position(); 140 | 141 | // what was a meant to mean? 142 | var a = true 143 | if (!a) { 144 | console.log('already selected'); 145 | // b.contents().unwrap() 146 | 147 | } else { 148 | previousSelection = ""; 149 | } 150 | 151 | // get category name information 152 | var cat1 = $('.category-1').html(); 153 | var cat2 = $('.category-2').html(); 154 | var cat3 = $('.category-3').html(); 155 | var cat4 = $('.category-4').html(); 156 | var cat5 = $('.category-5').html(); 157 | var cat6 = $('.category-6').html(); 158 | var cat7 = $('.category-7').html(); 159 | 160 | 161 | document.getElementById('tweet-box').innerHTML = 162 | '
' + 163 | '' + 164 | '' + 165 | '' + 166 | '' + 167 | '' + 168 | '' + 169 | '' + 170 | '' + 171 | '
'; 172 | drop.position(); 173 | 174 | // twttr.widgets.load(); 175 | } 176 | 177 | 178 | 179 | var $textarea = $('#content'); 180 | 181 | function RemoveAnnotation() { 182 | selection = window.getSelection(); 183 | var fragment = selection.getRangeAt(0).cloneContents(); 184 | var firstElement = fragment.firstElementChild; 185 | var firstElementStartTime = firstElement.getAttribute('data-m'); 186 | 187 | // close the drop 188 | closeDrop(); 189 | 190 | // console.log(selection.getRangeAt(0)); 191 | console.log(firstElementStartTime); 192 | findClass = "." + firstElementStartTime; 193 | console.log(findClass); 194 | // $("span").find("[data-m='" + firstElementStartTime + "']").css('background-color', 'red'); 195 | $("span").find("[data-m='" + firstElementStartTime + "']").unwrap(); 196 | 197 | var findClassAnnotation = "." + firstElementStartTime + "-annotation"; 198 | console.log(findClassAnnotation); 199 | 200 | 201 | var n = $(findClassAnnotation).data("cat"); 202 | 203 | // make annotation category glow on remove 204 | 205 | // need to get annotation category number 206 | 207 | // sleect data aatribute data-cat - it is the category number we want: n 208 | // it's of the paragraph with id 209 | // all info hightlight wants is category number 210 | // that's stored in the data-cat category 211 | // of the paragraph that's about to get deleted 212 | // .data("id") 213 | // var n = 10; 214 | var annotationLabel = ".category-" + n; 215 | highlight(annotationLabel); 216 | 217 | // remove annotations para 218 | $(findClassAnnotation).remove() 219 | 220 | // $("div").find("[class='" + firstElementStartTime + "'-annotation]").remove();; 221 | 222 | 223 | 224 | // $('.row').replaceWith(function() { 225 | // return $('ul', this); 226 | // }); 227 | // $('.row').replaceWith(function() { 228 | // return $('ul', this); 229 | // }); 230 | // $(w.startContainer.parentElement).replaceWith(function () { 231 | // return $(this).contents(); 232 | // }); 233 | } 234 | 235 | 236 | function SelectText(n) { 237 | 238 | 239 | // store selection in a variable 240 | var selection = window.getSelection(); 241 | 242 | 243 | 244 | // Make sure something was selected 245 | if (!selection.rangeCount) { 246 | 247 | return; 248 | } 249 | 250 | // get the text string 251 | var selText = selection.toString(); 252 | var annotationClassName = ".annotation-content-" + n; 253 | var annotationLabel = ".category-" + n; 254 | 255 | // get time of annotation 256 | // create a document fragment from the selection 257 | var fragment = selection.getRangeAt(0).cloneContents(); 258 | 259 | // parse the document fragment for the first element 260 | var firstElement = fragment.firstElementChild; 261 | // get the time attribute from the first element 262 | 263 | // check whether more than a word has been selected 264 | if (firstElement && firstElement.tagName == 'SPAN') { 265 | 266 | var firstElementStartTime = firstElement.getAttribute('data-m'); 267 | 268 | // convert milliseconds to minutes seconds 269 | var formattedStartTime = fmtMSS(firstElementStartTime / 1000) 270 | 271 | // append selected annotation to the accordion panel 272 | var newAnnotation = "

[" + formattedStartTime + "] " + selText + "

"; 273 | $(annotationClassName).append(newAnnotation); 274 | 275 | 276 | // className = firstElementStartTime + "-annotation"; 277 | // $(annotationClassName).addClass(className) 278 | 279 | // add unique classname from timecode 280 | // firstElementStartTime 281 | 282 | // make the category label glow 283 | highlight(annotationLabel); 284 | 285 | 286 | 287 | // class name of the button 288 | // this doesn't seem to actually get that? n give the class of the button 289 | var range = selection.getRangeAt(0); 290 | 291 | 292 | var $container = document.createElement('span'); 293 | $container.className = "selected selected-" + n; 294 | 295 | // Move the contents of the selection into the container 296 | $container.appendChild(range.extractContents()); 297 | 298 | // Move the container into the now empty range 299 | range.insertNode($container); 300 | 301 | // console.log(selectedText); 302 | // var spn = '' + selectedText + ''; 303 | // window.getSelection().html().replace(selectedText, ""); 304 | 305 | } else if (firstElement && firstElement.tagName == 'P') { 306 | console.log('outside papagraph'); 307 | alert('Please, select text inside one paragraph.') 308 | } else { 309 | console.log('just a fragment'); 310 | alert('Please, select more one word') 311 | 312 | } 313 | 314 | closeDrop(); 315 | 316 | } 317 | 318 | // function SelectText(n,previousSelection) { 319 | 320 | // previousSelection.contents().unwrap() 321 | 322 | // var selection = window.getSelection(); 323 | 324 | // // Make sure something was selected 325 | // if (!selection.rangeCount) { 326 | // return; 327 | // } 328 | 329 | // // class name of the button 330 | // var range = selection.getRangeAt(0); 331 | // var $container = document.createElement('span'); 332 | // $container.className = "selected selected-" + n; 333 | 334 | // // Move the contents of the selection into the container 335 | // $container.appendChild(range.extractContents()); 336 | 337 | // // Move the container into the now empty range 338 | // range.insertNode($container); 339 | 340 | // // console.log(selectedText); 341 | // // var spn = '' + selectedText + ''; 342 | // // window.getSelection().html().replace(selectedText, ""); 343 | // } 344 | 345 | // allow annotations to be edited 346 | 347 | // highlight annotated sections on clicking them 348 | $('#content').on("click", ".selected", function () { 349 | // true means it's already been highlighted 350 | 351 | 352 | 353 | var $this = $(this); 354 | addShareTool(false, $this) 355 | 356 | // console.log($this.contents().unwrap()); 357 | 358 | }); 359 | 360 | 361 | 362 | function closeDrop() { 363 | if (drop) { 364 | drop.close(); 365 | } 366 | } 367 | 368 | var transcript = document.getElementById('hypertranscript'); 369 | transcript.addEventListener('mouseup', addShareTool, false); 370 | transcript.addEventListener('touchend', addShareTool, false); 371 | transcript.addEventListener('click', closeDrop, true); 372 | -------------------------------------------------------------------------------- /javascript/trint-player.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | function msToTime(duration) { 4 | var milliseconds = parseInt((duration % 1000) / 100), 5 | seconds = parseInt((duration / 1000) % 60), 6 | minutes = parseInt((duration / (1000 * 60)) % 60), 7 | hours = parseInt((duration / (1000 * 60 * 60)) % 24); 8 | 9 | hours = hours < 10 ? '0' + hours : hours; 10 | minutes = minutes < 10 ? '0' + minutes : minutes; 11 | seconds = seconds < 10 ? '0' + seconds : seconds; 12 | 13 | return hours + ':' + minutes + ':' + seconds; 14 | } 15 | 16 | function escapeHtml(unsafe) { 17 | return unsafe 18 | .replace(/&/g, '&') 19 | .replace(//g, '>') 21 | .replace(/"/g, '"') 22 | .replace(/'/g, '''); 23 | } 24 | 25 | // var searchForm = document.getElementById('searchForm'); 26 | 27 | // if (searchForm) { 28 | // if (searchForm.addEventListener) { 29 | // //Modern browsers 30 | // searchForm.addEventListener( 31 | // 'submit', 32 | // function(event) { 33 | // searchPhrase(document.getElementById('search').value); 34 | // event.preventDefault(); 35 | // }, 36 | // false, 37 | // ); 38 | // } else if (searchForm.attachEvent) { 39 | // //Old IE 40 | // searchForm.attachEvent('onsubmit', function(event) { 41 | // searchPhrase(document.getElementById('search').value); 42 | // event.preventDefault(); 43 | // }); 44 | // } 45 | // } 46 | 47 | var words, wordsLen; //JSON 48 | var htmlWords, htmlWordsLen; //HTML 49 | 50 | htmlWords = document.querySelectorAll('[data-m]'); 51 | htmlWordsLen = htmlWords.length; 52 | 53 | // Replace htmlWords and htmlWordsLen with words and wordsLen below if you want 54 | // to take word data directly from JSON. 55 | // 56 | // When we export the player the transcript should probably be already inline 57 | // as HTML so as to search engine indexable, which is why the default 58 | // behaviour here is to use the HTML for the data as it will work in both cases. 59 | 60 | // var searchPhrase = function(phrase) { 61 | // var phraseWords = phrase.split(' '); 62 | // var phraseWordsLen = phraseWords.length; 63 | // var matchedTimes = []; 64 | 65 | // // clear matched times 66 | 67 | // var searchMatched = document.querySelectorAll('.search-match'); 68 | // var searchMatchedLen = searchMatched.length; 69 | 70 | // for (var l = 0; l < searchMatchedLen; l++) { 71 | // searchMatched[l].classList.remove('search-match'); 72 | // } 73 | 74 | // //for (var i = 0; i < wordsLen; i++) { 75 | // for (var i = 0; i < htmlWordsLen; i++) { 76 | // var numWordsMatched = 0; 77 | // var potentiallyMatched = []; 78 | 79 | // for (var j = 0; j < phraseWordsLen; j++) { 80 | // var wordIndex = i + numWordsMatched; 81 | 82 | // //if (wordIndex >= wordsLen) { 83 | // if (wordIndex >= htmlWordsLen) { 84 | // break; 85 | // } 86 | 87 | // // regex removes punctuation - NB for htmlWords case we also remove the space 88 | 89 | // //if (phraseWords[j].toLowerCase() == Words[wordIndex].name.toLowerCase().replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,"")) { 90 | // if ( 91 | // phraseWords[j].toLowerCase() == 92 | // htmlWords[wordIndex].innerHTML 93 | // .toLowerCase() 94 | // .replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~() ]/g, '') 95 | // ) { 96 | // //potentiallyMatched.push(words[wordIndex].time); 97 | // potentiallyMatched.push(htmlWords[wordIndex].getAttribute('data-m')); 98 | // numWordsMatched++; 99 | // } else { 100 | // break; 101 | // } 102 | 103 | // // if the num of words matched equal the search phrase we have a winner! 104 | 105 | // if (numWordsMatched >= phraseWordsLen) { 106 | // matchedTimes = matchedTimes.concat(potentiallyMatched); 107 | // } 108 | // } 109 | // } 110 | 111 | // // display 112 | // var matchedTimesLen = matchedTimes.length; 113 | 114 | // // only match the first word with that time (assuming times are unique) 115 | // for (var k = 0; k < matchedTimesLen; k++) { 116 | // document 117 | // .querySelectorAll("[data-m='" + matchedTimes[k] + "']")[0] 118 | // .classList.add('search-match'); 119 | // } 120 | // }; 121 | 122 | // if autoscroll disabled then don't make transcript interactive 123 | var autoScrollCheck = document.getElementById("autoscroll-off").checked; 124 | // if (autoScrollCheck) { 125 | // setTimeout( 126 | // function () { 127 | // console.log('transcript being initiated'); 128 | // hyper(true); 129 | 130 | // }, 1000) 131 | // } 132 | 133 | 134 | 135 | 136 | function hyper(scrollOn) { 137 | 138 | if (scrollOn == false) { 139 | // hyperaudiolite.init('plop', 'jns'); 140 | 141 | // puts wrong values into hyperaudio to turn it off 142 | // TODO implement something less dumb 143 | hyperaudiolite.init('d', 'd'); 144 | 145 | } else { 146 | console.log('init'); 147 | hyperaudiolite.init('hypertranscript', 'hyperplayer'); 148 | 149 | // playbackRate listener 150 | 151 | var v = document.getElementById('hyperplayer'); 152 | 153 | if (v.src && /\.m3u8$/.test(v.src)) { 154 | if (Hls.isSupported()) { 155 | var hls = new Hls(); 156 | hls.loadSource(v.src); 157 | hls.attachMedia(v); 158 | } else { 159 | console.log('Unable to load HLS video stream'); 160 | } 161 | } 162 | 163 | var p = document.getElementById('pbr'); 164 | var cp = document.getElementById('currentPbr'); 165 | var timecodeOffset = document.getElementById('timecodeOffset'); 166 | 167 | // turn on if you make a playback input 168 | // p.addEventListener( 169 | // 'input', 170 | // function() { 171 | // cp.innerHTML = p.value; 172 | // hyperplayer.playbackRate = p.value; 173 | // }, 174 | // false, 175 | // ); 176 | 177 | // below was for when timecode was displayed 178 | // var updateTimecode = function () { 179 | // var currentTimeMs = v.currentTime * 1000; 180 | // var time = currentTimeMs + window.offsetMs; 181 | // timecodeOffset.innerHTML = msToTime(time); 182 | // }; 183 | // updateTimecode(); 184 | // v.addEventListener('timeupdate', updateTimecode); 185 | } 186 | 187 | }; -------------------------------------------------------------------------------- /javascript/unused/index copy.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const path = require('path') 3 | const app = express(); 4 | const fs = require('fs'); 5 | 6 | 7 | let {PythonShell} = require('python-shell'); 8 | 9 | PythonShell.runString('x=1+1;print("hello")', null, function (err) { 10 | if (err) throw err; 11 | console.log('finished'); 12 | }); 13 | 14 | console.log('hey'); 15 | 16 | var sassMiddleware = require('node-sass-middleware'); 17 | 18 | const audioFolder = './audio/'; 19 | const jsonFolder = './json/'; 20 | const saveFolder = './saves/'; 21 | 22 | // // want to try save files to the repository to load from there 23 | // fs.writeFile("../saves", "Hey there!", function(err) { 24 | // if(err) { 25 | // return console.log(err); 26 | // } 27 | // console.log("The file was saved!"); 28 | // }); 29 | 30 | var audioList 31 | var jsonList 32 | 33 | if (app.get('env') == 'development') { 34 | var browserSync = require('browser-sync'); 35 | var config = { 36 | files: ["**/*.html", "dist/css/*.css", "**/*.js", "sass/**/*.scss"], 37 | logLevel: 'debug', 38 | logSnippet: false, 39 | reloadDelay: 3000, 40 | reloadOnRestart: true 41 | }; 42 | var bs = browserSync(config); 43 | app.use(require('connect-browser-sync')(bs)); 44 | } 45 | 46 | // TODO fix. tried to add this, it didn;t work, 47 | // app.use(sassMiddleware({ 48 | // /* Options */ 49 | // src: path.join(__dirname, 'src/scss'), 50 | // dest: path.join(__dirname, 'dist/css'), 51 | // debug: true, 52 | // indentedSyntax : false, 53 | // outputStyle: 'compressed', 54 | // // prefix: '/dist/css' // Where prefix is at 55 | // })); 56 | 57 | 58 | // list files in audio directory 59 | fs.readdir(audioFolder, (err, files) => { 60 | audioList = files 61 | }); 62 | 63 | // list files in json directory 64 | fs.readdir(jsonFolder, (err, files) => { 65 | jsonList = files 66 | }); 67 | 68 | // list files in save directory 69 | fs.readdir(saveFolder, (err, files) => { 70 | saveList = files 71 | }); 72 | 73 | 74 | app.get('/files', (req, res) => { 75 | data = [audioList, jsonList, saveList] 76 | res.send(data) 77 | }) 78 | 79 | 80 | app.use(express.static(path.join(__dirname, '/'))) 81 | 82 | // use default port or 5000 83 | const PORT = process.env.PORT || 5000 84 | 85 | app.listen(PORT, () => console.log(`Server started on port ${PORT}`)) 86 | 87 | // Serve static files out of the 'public' folder 88 | // app.use(express.static('./')) 89 | 90 | // Serve the index.html when users access the 91 | // root directory using res.sendFile() 92 | // app.get('/', (req, res) => { 93 | // res.send('hello') 94 | // // res.sendFile(__dirname + '/public/index.html') 95 | // }) 96 | 97 | 98 | 99 | 100 | 101 | 102 | // const express = require('express') 103 | // const path = require('path') 104 | 105 | // const members = [{ 106 | // id: 1, 107 | // name: "sam" 108 | // }] 109 | 110 | 111 | // const app = express(); 112 | 113 | // // body parser middleware 114 | // app.use(express.json()); 115 | // app.use(express.urlencoded({ extended: false })) 116 | 117 | // // const logger = (req, res, next) => { 118 | // // console.log(`${req.protocol}://${req.get('host')}${req.originalUrl}`); 119 | // // next(); 120 | // // } 121 | 122 | // // init middleware 123 | // // app.use(logger) 124 | 125 | // // gets members 126 | // app.get('/api/members', (req, res) => { 127 | // res.json(members) 128 | // }) 129 | 130 | // app.get('/api/members:id', (req,res) => { 131 | // res.json(members.filter(member => member.id === req.params.id)) 132 | // }) 133 | 134 | // app.post('/api/members', (req, res) => { 135 | // const newMember = { 136 | // name: req.body.name 137 | // } 138 | // res.json(members) 139 | // }) 140 | 141 | // app.use(express.static(path.join(__dirname, '/public'))) 142 | 143 | // // use default port or 5000 144 | // const PORT = process.env.PORT || 5000 145 | 146 | // app.listen(PORT, () => console.log(`Server started on port ${PORT}`)) 147 | 148 | // // Serve static files out of the 'public' folder 149 | // // app.use(express.static('./')) 150 | 151 | // // Serve the index.html when users access the 152 | // // root directory using res.sendFile() 153 | // // app.get('/', (req, res) => { 154 | // // res.send('hello') 155 | // // // res.sendFile(__dirname + '/public/index.html') 156 | // // }) -------------------------------------------------------------------------------- /javascript/unused/index-express.js: -------------------------------------------------------------------------------- 1 | // error stuff 2 | (function() { 3 | var childProcess = require("child_process"); 4 | var oldSpawn = childProcess.spawn; 5 | function mySpawn() { 6 | console.log('spawn called'); 7 | console.log(arguments); 8 | var result = oldSpawn.apply(this, arguments); 9 | return result; 10 | } 11 | childProcess.spawn = mySpawn; 12 | })(); 13 | 14 | const express = require('express') 15 | const path = require('path') 16 | const app = express(); 17 | const fs = require('fs'); 18 | 19 | app.use('/jquery', express.static(__dirname + '/node_modules/jquery/dist/')); 20 | 21 | 22 | // trying to get python to work 23 | 24 | const {PythonShell} = require('python-shell'); 25 | 26 | PythonShell.runString('print("hi")', null, function (err) { 27 | if (err) throw err; 28 | console.log('finished'); 29 | }); 30 | 31 | console.log('hey'); 32 | 33 | // the below works! 34 | // const {spawn} = require('child_process'); 35 | // app.get('/py', (req, res) => { 36 | // var dataToSend; 37 | // // spawn new child process to call the python script 38 | // const python = spawn('python', ['script.py']); 39 | // // collect data from script 40 | // python.stdout.on('data', function (data) { 41 | // console.log('Pipe data from python script ...'); 42 | // dataToSend = data.toString(); 43 | // }); 44 | // // in close event we are sure that stream from child process is closed 45 | // python.on('close', (code) => { 46 | // console.log(`child process close all stdio with code ${code}`); 47 | // // send data to browser 48 | // res.send(dataToSend) 49 | // }); 50 | // }) 51 | 52 | // var sassMiddleware = require('node-sass-middleware'); 53 | 54 | // note the filename was so hard to get right 55 | // it needs the process path to find the correct place 56 | const audioFolder = `${process.resourcesPath}/app/audio/`; 57 | const jsonFolder = `${process.resourcesPath}/app/json/`; 58 | const saveFolder = `${process.resourcesPath}/app/saves/`; 59 | 60 | // // want to try save files to the repository to load from there 61 | // fs.writeFile("../saves", "Hey there!", function(err) { 62 | // if(err) { 63 | // return console.log(err); 64 | // } 65 | // console.log("The file was saved!"); 66 | // }); 67 | 68 | var audioList 69 | var jsonList 70 | 71 | if (app.get('env') == 'development') { 72 | var browserSync = require('browser-sync'); 73 | var config = { 74 | files: ["**/*.html", "dist/css/*.css", "**/*.js", "sass/**/*.scss"], 75 | logLevel: 'debug', 76 | logSnippet: false, 77 | reloadDelay: 3000, 78 | reloadOnRestart: true 79 | }; 80 | var bs = browserSync(config); 81 | app.use(require('connect-browser-sync')(bs)); 82 | } 83 | 84 | // TODO fix. tried to add this, it didn;t work, 85 | // app.use(sassMiddleware({ 86 | // /* Options */ 87 | // src: path.join(__dirname, 'src/scss'), 88 | // dest: path.join(__dirname, 'dist/css'), 89 | // debug: true, 90 | // indentedSyntax : false, 91 | // outputStyle: 'compressed', 92 | // // prefix: '/dist/css' // Where prefix is at 93 | // })); 94 | 95 | 96 | // list files in audio directory 97 | fs.readdir(audioFolder, (err, files) => { 98 | audioList = files 99 | }); 100 | 101 | // list files in json directory 102 | fs.readdir(jsonFolder, (err, files) => { 103 | jsonList = files 104 | }); 105 | 106 | // list files in save directory 107 | fs.readdir(saveFolder, (err, files) => { 108 | saveList = files 109 | }); 110 | 111 | 112 | app.get('/files', (req, res) => { 113 | data = [audioList, jsonList, saveList] 114 | res.send(data) 115 | }) 116 | 117 | 118 | app.use(express.static(path.join(__dirname, '/'))) 119 | 120 | // use default port or 5000 121 | const PORT = process.env.PORT || 5000 122 | 123 | app.listen(PORT, () => console.log(`Server started on port ${PORT}`)) 124 | 125 | // Serve static files out of the 'public' folder 126 | // app.use(express.static('./')) 127 | 128 | // Serve the index.html when users access the 129 | // root directory using res.sendFile() 130 | // app.get('/', (req, res) => { 131 | // res.send('hello') 132 | // // res.sendFile(__dirname + '/public/index.html') 133 | // }) 134 | 135 | 136 | 137 | 138 | 139 | 140 | // const express = require('express') 141 | // const path = require('path') 142 | 143 | // const members = [{ 144 | // id: 1, 145 | // name: "sam" 146 | // }] 147 | 148 | 149 | // const app = express(); 150 | 151 | // // body parser middleware 152 | // app.use(express.json()); 153 | // app.use(express.urlencoded({ extended: false })) 154 | 155 | // // const logger = (req, res, next) => { 156 | // // console.log(`${req.protocol}://${req.get('host')}${req.originalUrl}`); 157 | // // next(); 158 | // // } 159 | 160 | // // init middleware 161 | // // app.use(logger) 162 | 163 | // // gets members 164 | // app.get('/api/members', (req, res) => { 165 | // res.json(members) 166 | // }) 167 | 168 | // app.get('/api/members:id', (req,res) => { 169 | // res.json(members.filter(member => member.id === req.params.id)) 170 | // }) 171 | 172 | // app.post('/api/members', (req, res) => { 173 | // const newMember = { 174 | // name: req.body.name 175 | // } 176 | // res.json(members) 177 | // }) 178 | 179 | // app.use(express.static(path.join(__dirname, '/public'))) 180 | 181 | // // use default port or 5000 182 | // const PORT = process.env.PORT || 5000 183 | 184 | // app.listen(PORT, () => console.log(`Server started on port ${PORT}`)) 185 | 186 | // // Serve static files out of the 'public' folder 187 | // // app.use(express.static('./')) 188 | 189 | // // Serve the index.html when users access the 190 | // // root directory using res.sendFile() 191 | // // app.get('/', (req, res) => { 192 | // // res.send('hello') 193 | // // // res.sendFile(__dirname + '/public/index.html') 194 | // // }) -------------------------------------------------------------------------------- /javascript/unused/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | const { app, BrowserWindow } = require("electron"); 4 | require('./index-express.js') 5 | 6 | let mainWindow; 7 | 8 | const createWindow = () => { 9 | mainWindow = new BrowserWindow({ 10 | height: 768, 11 | width: 1024 12 | }); 13 | mainWindow.loadURL("http://localhost:5000"); 14 | mainWindow.on("closed", () => { 15 | mainWindow = null; 16 | }); 17 | }; 18 | 19 | app.on("ready", createWindow); 20 | 21 | app.on("activate", () => mainWindow === null && createWindow()); 22 | 23 | app.on( 24 | "window-all-closed", 25 | () => process.platform !== "darwin" && app.quit() 26 | ); -------------------------------------------------------------------------------- /javascript/unused/requests.js: -------------------------------------------------------------------------------- 1 | $.get( "http://localhost:5000/files", function( data ) { 2 | 3 | var mySelect = $('#audioUrl'); 4 | $.each(data[0], function(val, text) { 5 | mySelect.append( 6 | $('').val(text).html(text) 7 | ); 8 | }); 9 | var mySelect = $('#user-filename'); 10 | $.each(data[1], function(val, text) { 11 | mySelect.append( 12 | $('').val(text).html(text) 13 | ); 14 | }); 15 | var mySelect = $('#html-load'); 16 | $.each(data[2], function(val, text) { 17 | mySelect.append( 18 | $('').val(text).html(text) 19 | ); 20 | }); 21 | 22 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scription", 3 | "version": "1.0.0", 4 | "description": "Scription is an interactive transcript editor.", 5 | "scripts": { 6 | "scss": "node-sass --output-style compressed -o css src/scss", 7 | "dev": "browser-sync start --server --files '**/*.css, **/*.html, **/*.js'", 8 | "watch:css": "onchange 'src/scss' -- npm run scss", 9 | "start" : "http-server", 10 | "express": "node index-express", 11 | "electron": "electron .", 12 | "package": "electron-packager .", 13 | "build": "" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/smlum/scription.git" 18 | }, 19 | "author": "sam", 20 | "license": "ISC", 21 | "bugs": { 22 | "url": "https://github.com/smlum/scription/issues" 23 | }, 24 | "homepage": "https://github.com/smlum/scription", 25 | "devDependencies": { 26 | "browser-sync": "^2.26.7", 27 | "bulma": "^0.8.0", 28 | "bulma-switch": "^2.0.0", 29 | "connect-browser-sync": "^2.1.0", 30 | "http-server": "^0.12.3", 31 | "nodemon": "^2.0.2", 32 | "npm-run-all": "^4.1.5", 33 | "onchange": "^6.1.0" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /todo.MD: -------------------------------------------------------------------------------- 1 | General: 2 | - Update documentation 3 | - Upload instructions, save options, exports 4 | 5 | Known issues with workarounds: 6 | - Export text removes paragraphs - for now use copy and paste 7 | - Large audio files cause text-audio sync issues - recommended to compress large audio files (constant bit rate, 8kbps, 8k sample rate). E.g. use Audacity for single files or ffmpeg for multiple: 8 | `find ./ -name “*.mp3” -exec ffmpeg -i "{}" -codec:a libmp3lame -b:a 8k -ac 1 -ar 8000 '$(basename {} min)’.mp3 \;` 9 | 10 | Bugs: 11 | - Live demo loads transcript over autosaved one 12 | - Speakers get messed up on long audio 13 | - Play button disappears on local deployment 14 | - Annotations popup gets stuck when using ‘remove’ 15 | - Only some elements in annotation panel are saved 16 | 17 | Priority features: 18 | - Optimise for deployment on local server 19 | - Autosave indicator 20 | - Compatability with anything other than two speakers (untested) 21 | 22 | Partially implemented: 23 | - Compatibility with Mozilla DeepSpeech 24 | 25 | - User sets confidence level 26 | 27 | Long-term features: 28 | - Call transcription APIs within app 29 | - Google, MS, IBM compatibility (look up data standards) 30 | - Audio processing within app (ffmpeg?) 31 | 32 | Really long term features: 33 | - Train a custom DeepSpeech model with user corrections 34 | - Natural language understanding 35 | --------------------------------------------------------------------------------