@@ -61,11 +61,11 @@ class Howler {
61
61
62
62
/**
63
63
* Get/set the global volume for all sounds.
64
- * @param { Float } vol Volume from 0.0 to 1.0.
65
- * @return { Howler/Float } Returns self or current volume.
64
+ * @param vol Volume from 0.0 to 1.0.
65
+ * @return Returns self or current volume.
66
66
*/
67
- volume ( vol ?: string ) {
68
- const volume = typeof vol === 'string' ? parseFloat ( vol ) : undefined ;
67
+ volume ( vol ?: number | string ) {
68
+ const volume = parseFloat ( vol as string ) ;
69
69
70
70
// If we don't have an AudioContext created yet, run the setup.
71
71
if ( ! this . ctx ) {
@@ -164,7 +164,6 @@ class Howler {
164
164
165
165
/**
166
166
* Unload and destroy all currently loaded Howl objects.
167
- * @return {Howler }
168
167
*/
169
168
unload ( ) {
170
169
for ( var i = this . _howls . length - 1 ; i >= 0 ; i -- ) {
@@ -187,15 +186,14 @@ class Howler {
187
186
188
187
/**
189
188
* Check for codec support of specific extension.
190
- * @param { String } ext Audio file extention.
189
+ * @param ext Audio file extention.
191
190
*/
192
191
codecs ( ext : string ) {
193
192
return this . _codecs [ ext . replace ( / ^ x - / , '' ) ] ;
194
193
}
195
194
196
195
/**
197
196
* Setup various state values for global tracking.
198
- * @return {Howler }
199
197
*/
200
198
_setup ( ) {
201
199
// Keeps track of the suspend/resume state of the AudioContext.
@@ -306,7 +304,6 @@ class Howler {
306
304
307
305
/**
308
306
* Check for browser support for various codecs and cache the results.
309
- * @return {Howler }
310
307
*/
311
308
_setupCodecs ( ) {
312
309
let audioTest : HTMLAudioElement | null = null ;
@@ -517,7 +514,7 @@ class Howler {
517
514
/**
518
515
* Get an unlocked HTML5 Audio object from the pool. If none are left,
519
516
* return a new Audio object and throw a warning.
520
- * @return { Audio } HTML5 Audio object.
517
+ * @return HTML5 Audio object.
521
518
*/
522
519
_obtainHtml5Audio ( ) {
523
520
// Return the next object from the pool if one exists.
@@ -545,7 +542,6 @@ class Howler {
545
542
546
543
/**
547
544
* Return an activated HTML5 Audio object to the pool.
548
- * @return {Howler }
549
545
*/
550
546
_releaseHtml5Audio ( audio : HowlerAudioElement ) {
551
547
// Don't add audio to the pool if we don't know if it has been unlocked.
@@ -559,7 +555,6 @@ class Howler {
559
555
/**
560
556
* Automatically suspend the Web Audio AudioContext after no sound has played for 30 seconds.
561
557
* This saves processing/energy and fixes various browser-specific bugs with audio getting stuck.
562
- * @return {Howler }
563
558
*/
564
559
_autoSuspend ( ) {
565
560
if (
@@ -617,7 +612,6 @@ class Howler {
617
612
618
613
/**
619
614
* Automatically resume the Web Audio AudioContext when a new sound is played.
620
- * @return {Howler }
621
615
*/
622
616
_autoResume ( ) {
623
617
if (
0 commit comments