Commit ef3cb1f
committed
Sound in Web Audio now uses AudioContext.onended to trigger when it will stop playing instead of using a time based value. This is only used if the sound doesn't loop and isn't an audio sprite, but will give a much more accurate
Sound.onStop event. It also prevents short audio files from being cut off during playback (phaserjs#1471) and accounts for time spent decoding.1 parent eba1743 commit ef3cb1f
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
379 | 393 | | |
380 | 394 | | |
381 | 395 | | |
| |||
423 | 437 | | |
424 | 438 | | |
425 | 439 | | |
426 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
427 | 445 | | |
428 | 446 | | |
429 | 447 | | |
| |||
595 | 613 | | |
596 | 614 | | |
597 | 615 | | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
598 | 621 | | |
599 | 622 | | |
| 623 | + | |
| 624 | + | |
600 | 625 | | |
601 | 626 | | |
602 | 627 | | |
603 | 628 | | |
604 | | - | |
| 629 | + | |
605 | 630 | | |
606 | 631 | | |
607 | 632 | | |
| |||
788 | 813 | | |
789 | 814 | | |
790 | 815 | | |
| 816 | + | |
| 817 | + | |
791 | 818 | | |
792 | 819 | | |
793 | 820 | | |
| |||
0 commit comments