Guest User

Untitled

a guest
Jan 21st, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. createSound(time: any, char: string) {
  2. for (const c of char) {
  3. switch (c) {
  4. case '.':
  5. this.gain.gain.setValueAtTime(1.0, time);
  6. time += this.dot;
  7. this.gain.gain.setValueAtTime(0.0, time);
  8. break;
  9. case '-':
  10. this.gain.gain.setValueAtTime(1.0, time);
  11. time += 3 * this.dot;
  12. this.gain.gain.setValueAtTime(0.0, time);
  13. break;
  14. }
  15. time += this.dot;
  16. }
  17.  
  18. return time;
  19. }
Add Comment
Please, Sign In to add comment