clicktone 1.8.0-dev.0 → 2.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -42
- package/dist/index.cjs.js +3 -1
- package/dist/index.d.ts +2 -33
- package/dist/index.es.js +264 -77
- package/dist/index.umd.js +3 -1
- package/package.json +34 -24
package/README.md
CHANGED
|
@@ -1,64 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
<p align="center"><strong>clicktone</strong></p>
|
|
1
|
+
# clicktone
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
A lightweight helper for UI sound feedback. It wraps the Web Audio API with a tiny, event-based API and a rock-solid iOS/Safari unlock.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
- Single shared `AudioContext` for every instance (no iOS context-limit issues).
|
|
6
|
+
- Reliable autoplay unlock: eager gesture listeners, synchronous resume, silent priming ping, re-resume on `visibilitychange`.
|
|
7
|
+
- Automatic format fallback via `canPlayType` (great for Safari, which dislikes OGG/Opus).
|
|
8
|
+
- Shared decode cache, throttling, volume control, and subtle pitch variation.
|
|
9
|
+
- Event-based (`EventTarget`) with a typed `on()` / `once()` API; `play()` also returns a `Promise`.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
## Install
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
<p align="center"><sup>1kB gzipped</sup></p>
|
|
14
|
-
<p align="center"><a href="https://codepen.io/ux-ui/pen/yLwbmMr">Demo</a></p>
|
|
15
|
-
<br>
|
|
16
|
-
|
|
17
|
-
➤ **Install**
|
|
18
|
-
|
|
19
|
-
```console
|
|
13
|
+
```bash
|
|
20
14
|
yarn add clicktone
|
|
21
15
|
```
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
## Usage (TypeScript)
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
```ts
|
|
20
|
+
import { ClickTone } from 'clicktone';
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
import ClickTone from 'clicktone';
|
|
29
|
-
```
|
|
30
|
-
<br>
|
|
22
|
+
const button = document.getElementById('clickBtn');
|
|
31
23
|
|
|
32
|
-
|
|
24
|
+
if (!button) {
|
|
25
|
+
throw new Error('Demo DOM is not ready');
|
|
26
|
+
}
|
|
33
27
|
|
|
34
|
-
<sub>ClickTone uses the Web Audio API, which supports many audio file formats: MP3, WAV, OGG, AAC and others. Note that not all browsers support these formats.</sub>
|
|
35
|
-
```javascript
|
|
36
28
|
const sound = new ClickTone({
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
// A single source…
|
|
30
|
+
src: new URL('./assets/click.mp3', import.meta.url).href,
|
|
31
|
+
|
|
32
|
+
// …or a fallback list; the best supported format is picked automatically:
|
|
33
|
+
// src: ['./click.aac', './click.ogg', './click.mp3'],
|
|
34
|
+
|
|
39
35
|
volume: 0.7,
|
|
40
36
|
throttle: 100,
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
pitchVariation: 0.08,
|
|
38
|
+
preload: true,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
sound.on('error', (error) => console.error(error));
|
|
42
|
+
button.addEventListener('click', () => sound.play());
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The `src` option also accepts DOM elements: an `HTMLSourceElement`, an `HTMLAudioElement` (its child `<source>` elements become the fallback list), or `{ id }` referencing either of those by id.
|
|
46
|
+
|
|
47
|
+
## Usage (Vue 3)
|
|
48
|
+
|
|
49
|
+
```vue
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import { onBeforeUnmount, onMounted, shallowRef } from 'vue';
|
|
52
|
+
import { ClickTone } from 'clicktone';
|
|
53
|
+
|
|
54
|
+
const sound = shallowRef<ClickTone | null>(null);
|
|
55
|
+
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
sound.value = new ClickTone({
|
|
58
|
+
src: new URL('./assets/click.mp3', import.meta.url).href,
|
|
59
|
+
volume: 0.7,
|
|
60
|
+
pitchVariation: 0.08,
|
|
61
|
+
preload: true,
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
onBeforeUnmount(() => {
|
|
66
|
+
sound.value?.destroy();
|
|
67
|
+
sound.value = null;
|
|
43
68
|
});
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
<button @click="sound?.play()">Click</button>
|
|
73
|
+
</template>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Events
|
|
44
77
|
|
|
45
|
-
|
|
78
|
+
`ClickTone` extends `EventTarget`. Subscribe with the typed `on()` / `once()` helpers (which return an unsubscribe function) or with native `addEventListener`.
|
|
46
79
|
|
|
47
|
-
|
|
80
|
+
```ts
|
|
81
|
+
const off = sound.on('end', () => console.log('finished'));
|
|
82
|
+
sound.on('error', (error) => console.error(error));
|
|
83
|
+
sound.once('unlock', () => console.log('audio unlocked'));
|
|
84
|
+
|
|
85
|
+
off();
|
|
86
|
+
|
|
87
|
+
// play() also resolves when playback ends:
|
|
88
|
+
await sound.play();
|
|
48
89
|
```
|
|
49
|
-
<br>
|
|
50
90
|
|
|
51
|
-
|
|
91
|
+
| Event | Detail | Fired when |
|
|
92
|
+
|:---------|:--------------|:-------------------------------------------|
|
|
93
|
+
| `play` | — | A buffer source has started. |
|
|
94
|
+
| `end` | — | Playback finished. |
|
|
95
|
+
| `unlock` | — | The shared `AudioContext` became playable. |
|
|
96
|
+
| `load` | `AudioBuffer` | A source was fetched and decoded. |
|
|
97
|
+
| `error` | `Error` | Loading, decoding, or playback failed. |
|
|
98
|
+
|
|
99
|
+
## iOS / Safari unlock
|
|
52
100
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
101
|
+
Mobile browsers (especially Safari on iOS) block audio until the user interacts with the page, an `AudioContext` must be resumed synchronously inside a user gesture, and iOS caps the number of contexts you may create. ClickTone handles all of this:
|
|
102
|
+
|
|
103
|
+
- One shared `AudioContext` (with `latencyHint: 'interactive'`) — one unlock unlocks every instance.
|
|
104
|
+
- Global gesture listeners (`pointerdown` / `pointerup` / `touchstart` / `touchend` / `keydown`) resume the context on the first interaction anywhere on the page.
|
|
105
|
+
- A silent priming ping is played right after unlock, and the context is re-resumed on `visibilitychange`.
|
|
106
|
+
- Decoded buffers are cached and shared, so the first click is not delayed by the network.
|
|
107
|
+
|
|
108
|
+
Pass `preload: true` (or call `sound.preload()`) so the buffer is decoded ahead of the first click. Include an MP3/AAC source for Safari — OGG/Opus is not reliably supported there.
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
await sound.preload();
|
|
112
|
+
|
|
113
|
+
// Or unlock the shared context on a known first interaction:
|
|
114
|
+
document.addEventListener('pointerdown', () => ClickTone.unlock(), { once: true });
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Options
|
|
118
|
+
|
|
119
|
+
| Option | Type | Default | Description |
|
|
120
|
+
|:-----------------|:--------------------------------------------------------------------------------------------|:-------:|:-----------------------------------------------------------------------------|
|
|
121
|
+
| `src` | `string \| URL \| {src,type?} \| {id} \| HTMLSourceElement \| HTMLAudioElement \| Array<…>` | — | Audio source(s). Pass an array to enable automatic format fallback. |
|
|
122
|
+
| `volume` | `number` | `1` | Playback volume `0`–`1`. |
|
|
123
|
+
| `muted` | `boolean` | `false` | Start muted. Toggle later via `setMuted()` / `toggleMuted()`. |
|
|
124
|
+
| `throttle` | `number` | `0` | Debounce interval in ms. Requests arriving sooner are ignored. |
|
|
125
|
+
| `pitchVariation` | `number` | `0` | `0`–`1`. Random playback-rate jitter so repeated clicks don't sound identical. |
|
|
126
|
+
| `preload` | `boolean` | `false` | Fetch and decode the buffer on construction. |
|
|
127
|
+
| `debug` | `boolean` | `false` | Log internal errors to the console (in addition to the `error` event). |
|
|
128
|
+
|
|
129
|
+
## Methods
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
await sound.play(); // optionally play(src) to override the source
|
|
133
|
+
await sound.preload(); // optionally preload(src)
|
|
134
|
+
sound.unlock();
|
|
135
|
+
sound.setVolume(0.5); // smoothly ramped
|
|
136
|
+
sound.setMuted(true);
|
|
137
|
+
sound.toggleMuted();
|
|
138
|
+
sound.on('end', () => {}); // on(type, fn) / once(type, fn)
|
|
139
|
+
sound.destroy();
|
|
140
|
+
|
|
141
|
+
ClickTone.unlock(); // static: unlock the shared context
|
|
142
|
+
ClickTone.unlocked; // static: whether the shared context is unlocked
|
|
143
|
+
```
|
|
61
144
|
|
|
62
|
-
|
|
145
|
+
## License
|
|
63
146
|
|
|
64
|
-
|
|
147
|
+
MIT
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=["pointerdown","pointerup","touchstart","touchend","keydown"],p={mp3:"audio/mpeg",m4a:"audio/mp4",mp4:"audio/mp4",aac:"audio/aac",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg; codecs=opus",wav:"audio/wav",webm:"audio/webm",flac:"audio/flac"},c=typeof window<"u"&&typeof document<"u",u=()=>{},d=t=>!Number.isFinite(t)||t<0?0:t>1?1:t,w=class{#t=null;#r=!1;#i=!1;#n=null;#a=new Map;#s=new Set;get unlocked(){return this.#r}prime(){this.#i||!c||(this.#i=!0,this.#e(),this.#o())}context(){if(this.#t||!c)return this.#t;const t=window.AudioContext??window.webkitAudioContext;if(!t)return null;try{this.#t=new t({latencyHint:"interactive"})}catch{this.#t=new t}return this.#t}unlock(){const t=this.context();if(t){if(t.state==="running"){this.#c();return}t.resume().then(()=>this.#c()).catch(u)}}onUnlock(t){if(this.#r){t();return}this.#s.add(t)}decode(t){const e=this.#a.get(t);if(e)return e;const n=this.context();if(!n)return Promise.reject(new Error("Web Audio API is not available."));const i=(async()=>{const r=await fetch(t);if(!r.ok)throw new Error(`Failed to fetch "${t}": ${r.status} ${r.statusText}`);return n.decodeAudioData(await r.arrayBuffer())})();return this.#a.set(t,i),i.catch(()=>this.#a.delete(t)),i}#c(){if(this.#r)return;this.#r=!0,this.#u(),this.#n?.(),this.#n=null;const t=[...this.#s];this.#s.clear(),t.forEach(e=>{e()})}#u(){const t=this.#t;if(t)try{const e=t.createBuffer(1,1,Math.max(22050,t.sampleRate)),n=t.createBufferSource();n.buffer=e;const i=t.createGain();i.gain.value=1e-5,n.connect(i),i.connect(t.destination),n.start(0),n.stop(0)}catch{}}#e(){const t={passive:!0,capture:!0},e=()=>this.unlock();l.forEach(n=>{window.addEventListener(n,e,t)}),this.#n=()=>{l.forEach(n=>{window.removeEventListener(n,e,t)})}}#o(){const t=()=>{document.hidden||!this.#r||this.#t?.resume().catch(u)};document.addEventListener("visibilitychange",t)}},o=new w,y=t=>{const e=t.split(/[?#]/,1)[0];return p[e.slice(e.lastIndexOf(".")+1).toLowerCase()]},m=t=>{if(typeof t=="string")return[{src:t}];if(t instanceof URL)return[{src:t.href}];if(c&&t instanceof HTMLSourceElement){if(!t.src)throw new Error('<source> element has no "src" attribute.');return[{src:t.src,type:t.type||void 0}]}if(c&&t instanceof HTMLAudioElement){const e=Array.from(t.querySelectorAll("source")).filter(n=>n.src).map(n=>({src:n.src,type:n.type||void 0}));if(e.length)return e;if(t.src)return[{src:t.src}];throw new Error("<audio> element has no playable sources.")}if(typeof t=="object"&&t!==null&&"id"in t){if(!c)throw new Error("Cannot resolve element by id outside the DOM.");const e=document.getElementById(String(t.id));if(!e)throw new Error(`No element found with id "${t.id}".`);if(e instanceof HTMLSourceElement||e instanceof HTMLAudioElement)return m(e);throw new Error(`Element with id "${t.id}" is not a <source> or <audio> element.`)}if(typeof t=="object"&&t!==null&&"src"in t){if(!t.src)throw new Error('Source descriptor has an empty "src".');return[{src:t.src,type:t.type}]}throw new Error("Invalid sound source.")},f=t=>{const e=(Array.isArray(t)?t:[t]).flatMap(m);if(!e.length)throw new Error("No sound source provided.");if(e.length===1||!c)return e[0].src;const n=document.createElement("audio");let i=null;for(const r of e){const a=r.type??y(r.src);if(!a)continue;const s=n.canPlayType(a);if(s==="probably")return r.src;s==="maybe"&&i===null&&(i=r.src)}return i??e[0].src},v=class extends EventTarget{#t=null;#r=null;#i;#n;#a;#s;#c;#u=0;#e=null;#o=!1;constructor({src:t,volume:e=1,muted:n=!1,throttle:i=0,pitchVariation:r=0,preload:a=!1,debug:s=!1}){super(),this.#i=d(e),this.#n=n,this.#a=Math.max(0,i),this.#s=Math.min(1,Math.max(0,r)),this.#c=s;try{this.#t=f(t)}catch(h){this.#r=h}o.prime(),o.onUnlock(()=>this.#h("unlock")),a&&this.preload()}static unlock(){o.prime(),o.unlock()}static get unlocked(){return o.unlocked}get volume(){return this.#i}get muted(){return this.#n}async preload(){if(!(this.#o||!this.#t))try{const t=await o.decode(this.#t);return this.#h("load",t),t}catch(t){this.#l(t);return}}unlock(){o.unlock()}setVolume(t){this.#i=d(t),this.#e&&!this.#n&&this.#d(this.#i)}setMuted(t){this.#n=t,this.#e&&this.#d(t?0:this.#i),t||o.unlock()}toggleMuted(){return this.setMuted(!this.#n),this.#n}async play(t){if(this.#o)return;const e=Date.now();if(e-this.#u<this.#a)return;this.#u=e,o.unlock();let n;try{n=t?f(t):this.#f()}catch(i){this.#l(i);return}try{const i=await o.decode(n),r=o.context();if(!r||this.#o)return;r.state!=="running"&&await r.resume().catch(u);const a=this.#m(r),s=r.createBufferSource();s.buffer=i,this.#s>0&&(s.playbackRate.value=Math.max(.5,1+(Math.random()*2-1)*this.#s)),s.connect(a),this.#h("play"),await new Promise(h=>{s.onended=()=>{s.disconnect(),h()},s.start(0)}),this.#h("end")}catch(i){this.#l(i)}}on(t,e){const n=i=>e(i.detail);return this.addEventListener(t,n),()=>this.removeEventListener(t,n)}once(t,e){const n=i=>e(i.detail);this.addEventListener(t,n,{once:!0})}destroy(){this.#o||(this.#o=!0,this.#e?.disconnect(),this.#e=null)}#f(){if(this.#t)return this.#t;throw this.#r??new Error("No valid sound source.")}#m(t){return(!this.#e||this.#e.context!==t)&&(this.#e=t.createGain(),this.#e.gain.value=this.#n?0:this.#i,this.#e.connect(t.destination)),this.#e}#d(t){const e=this.#e;if(!e)return;const n=e.context.currentTime;e.gain.cancelScheduledValues(n),e.gain.setValueAtTime(e.gain.value,n),e.gain.linearRampToValueAtTime(t,n+.015)}#h(t,e){if(typeof CustomEvent<"u")this.dispatchEvent(new CustomEvent(t,{detail:e}));else if(typeof Event<"u"){const n=new Event(t);n.detail=e,this.dispatchEvent(n)}}#l(t){this.#c,this.#h("error",t)}};exports.ClickTone=v;
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
webkitAudioContext?: typeof AudioContext;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
type FileSource = string | HTMLSourceElement | {
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
|
-
declare class ClickTone {
|
|
10
|
-
private readonly fileSource;
|
|
11
|
-
private readonly volume;
|
|
12
|
-
private readonly callback;
|
|
13
|
-
private readonly throttle;
|
|
14
|
-
private readonly debug;
|
|
15
|
-
private lastClickTime;
|
|
16
|
-
private readonly audioCache;
|
|
17
|
-
private audioContext;
|
|
18
|
-
constructor({ file, volume, callback, throttle, debug, }: {
|
|
19
|
-
file: FileSource;
|
|
20
|
-
volume?: number;
|
|
21
|
-
callback?: ((error?: Error) => void) | null;
|
|
22
|
-
throttle?: number;
|
|
23
|
-
debug?: boolean;
|
|
24
|
-
});
|
|
25
|
-
private resolveFileUrl;
|
|
26
|
-
private initAudioContext;
|
|
27
|
-
private iOSFixAudioContext;
|
|
28
|
-
private fetchAndDecodeAudio;
|
|
29
|
-
private playAudio;
|
|
30
|
-
private throttleFn;
|
|
31
|
-
play(file?: FileSource): void;
|
|
32
|
-
}
|
|
33
|
-
export default ClickTone;
|
|
1
|
+
export * from './main'
|
|
2
|
+
export {}
|
package/dist/index.es.js
CHANGED
|
@@ -1,93 +1,280 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
var l = [
|
|
2
|
+
"pointerdown",
|
|
3
|
+
"pointerup",
|
|
4
|
+
"touchstart",
|
|
5
|
+
"touchend",
|
|
6
|
+
"keydown"
|
|
7
|
+
], p = {
|
|
8
|
+
mp3: "audio/mpeg",
|
|
9
|
+
m4a: "audio/mp4",
|
|
10
|
+
mp4: "audio/mp4",
|
|
11
|
+
aac: "audio/aac",
|
|
12
|
+
oga: "audio/ogg",
|
|
13
|
+
ogg: "audio/ogg",
|
|
14
|
+
opus: "audio/ogg; codecs=opus",
|
|
15
|
+
wav: "audio/wav",
|
|
16
|
+
webm: "audio/webm",
|
|
17
|
+
flac: "audio/flac"
|
|
18
|
+
}, c = typeof window < "u" && typeof document < "u", u = () => {
|
|
19
|
+
}, d = (t) => !Number.isFinite(t) || t < 0 ? 0 : t > 1 ? 1 : t, w = class {
|
|
20
|
+
#t = null;
|
|
21
|
+
#i = !1;
|
|
22
|
+
#r = !1;
|
|
23
|
+
#n = null;
|
|
24
|
+
#a = /* @__PURE__ */ new Map();
|
|
25
|
+
#s = /* @__PURE__ */ new Set();
|
|
26
|
+
get unlocked() {
|
|
27
|
+
return this.#i;
|
|
28
|
+
}
|
|
29
|
+
prime() {
|
|
30
|
+
this.#r || !c || (this.#r = !0, this.#e(), this.#o());
|
|
31
|
+
}
|
|
32
|
+
context() {
|
|
33
|
+
if (this.#t || !c) return this.#t;
|
|
34
|
+
const t = window.AudioContext ?? window.webkitAudioContext;
|
|
35
|
+
if (!t) return null;
|
|
36
|
+
try {
|
|
37
|
+
this.#t = new t({ latencyHint: "interactive" });
|
|
38
|
+
} catch {
|
|
39
|
+
this.#t = new t();
|
|
28
40
|
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}).catch((e) => {
|
|
40
|
-
this.debug;
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
document.body.addEventListener("touchstart", t, !1), document.body.addEventListener("touchend", t, !1);
|
|
41
|
+
return this.#t;
|
|
42
|
+
}
|
|
43
|
+
unlock() {
|
|
44
|
+
const t = this.context();
|
|
45
|
+
if (t) {
|
|
46
|
+
if (t.state === "running") {
|
|
47
|
+
this.#c();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
t.resume().then(() => this.#c()).catch(u);
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return this.audioCache[t] = i, i;
|
|
51
|
-
} catch (e) {
|
|
52
|
-
throw this.debug, new Error(`Something went wrong when loading and decoding the audio: ${e.message}`);
|
|
53
|
+
onUnlock(t) {
|
|
54
|
+
if (this.#i) {
|
|
55
|
+
t();
|
|
56
|
+
return;
|
|
53
57
|
}
|
|
58
|
+
this.#s.add(t);
|
|
59
|
+
}
|
|
60
|
+
decode(t) {
|
|
61
|
+
const e = this.#a.get(t);
|
|
62
|
+
if (e) return e;
|
|
63
|
+
const n = this.context();
|
|
64
|
+
if (!n) return Promise.reject(/* @__PURE__ */ new Error("Web Audio API is not available."));
|
|
65
|
+
const r = (async () => {
|
|
66
|
+
const i = await fetch(t);
|
|
67
|
+
if (!i.ok) throw new Error(`Failed to fetch "${t}": ${i.status} ${i.statusText}`);
|
|
68
|
+
return n.decodeAudioData(await i.arrayBuffer());
|
|
69
|
+
})();
|
|
70
|
+
return this.#a.set(t, r), r.catch(() => this.#a.delete(t)), r;
|
|
71
|
+
}
|
|
72
|
+
#c() {
|
|
73
|
+
if (this.#i) return;
|
|
74
|
+
this.#i = !0, this.#u(), this.#n?.(), this.#n = null;
|
|
75
|
+
const t = [...this.#s];
|
|
76
|
+
this.#s.clear(), t.forEach((e) => {
|
|
77
|
+
e();
|
|
78
|
+
});
|
|
54
79
|
}
|
|
55
|
-
|
|
56
|
-
this
|
|
80
|
+
#u() {
|
|
81
|
+
const t = this.#t;
|
|
82
|
+
if (t)
|
|
83
|
+
try {
|
|
84
|
+
const e = t.createBuffer(1, 1, Math.max(22050, t.sampleRate)), n = t.createBufferSource();
|
|
85
|
+
n.buffer = e;
|
|
86
|
+
const r = t.createGain();
|
|
87
|
+
r.gain.value = 1e-5, n.connect(r), r.connect(t.destination), n.start(0), n.stop(0);
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
#e() {
|
|
92
|
+
const t = {
|
|
93
|
+
passive: !0,
|
|
94
|
+
capture: !0
|
|
95
|
+
}, e = () => this.unlock();
|
|
96
|
+
l.forEach((n) => {
|
|
97
|
+
window.addEventListener(n, e, t);
|
|
98
|
+
}), this.#n = () => {
|
|
99
|
+
l.forEach((n) => {
|
|
100
|
+
window.removeEventListener(n, e, t);
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
#o() {
|
|
105
|
+
const t = () => {
|
|
106
|
+
document.hidden || !this.#i || this.#t?.resume().catch(u);
|
|
107
|
+
};
|
|
108
|
+
document.addEventListener("visibilitychange", t);
|
|
109
|
+
}
|
|
110
|
+
}, o = new w(), y = (t) => {
|
|
111
|
+
const e = t.split(/[?#]/, 1)[0];
|
|
112
|
+
return p[e.slice(e.lastIndexOf(".") + 1).toLowerCase()];
|
|
113
|
+
}, m = (t) => {
|
|
114
|
+
if (typeof t == "string") return [{ src: t }];
|
|
115
|
+
if (t instanceof URL) return [{ src: t.href }];
|
|
116
|
+
if (c && t instanceof HTMLSourceElement) {
|
|
117
|
+
if (!t.src) throw new Error('<source> element has no "src" attribute.');
|
|
118
|
+
return [{
|
|
119
|
+
src: t.src,
|
|
120
|
+
type: t.type || void 0
|
|
121
|
+
}];
|
|
122
|
+
}
|
|
123
|
+
if (c && t instanceof HTMLAudioElement) {
|
|
124
|
+
const e = Array.from(t.querySelectorAll("source")).filter((n) => n.src).map((n) => ({
|
|
125
|
+
src: n.src,
|
|
126
|
+
type: n.type || void 0
|
|
127
|
+
}));
|
|
128
|
+
if (e.length) return e;
|
|
129
|
+
if (t.src) return [{ src: t.src }];
|
|
130
|
+
throw new Error("<audio> element has no playable sources.");
|
|
131
|
+
}
|
|
132
|
+
if (typeof t == "object" && t !== null && "id" in t) {
|
|
133
|
+
if (!c) throw new Error("Cannot resolve element by id outside the DOM.");
|
|
134
|
+
const e = document.getElementById(String(t.id));
|
|
135
|
+
if (!e) throw new Error(`No element found with id "${t.id}".`);
|
|
136
|
+
if (e instanceof HTMLSourceElement || e instanceof HTMLAudioElement) return m(e);
|
|
137
|
+
throw new Error(`Element with id "${t.id}" is not a <source> or <audio> element.`);
|
|
138
|
+
}
|
|
139
|
+
if (typeof t == "object" && t !== null && "src" in t) {
|
|
140
|
+
if (!t.src) throw new Error('Source descriptor has an empty "src".');
|
|
141
|
+
return [{
|
|
142
|
+
src: t.src,
|
|
143
|
+
type: t.type
|
|
144
|
+
}];
|
|
145
|
+
}
|
|
146
|
+
throw new Error("Invalid sound source.");
|
|
147
|
+
}, f = (t) => {
|
|
148
|
+
const e = (Array.isArray(t) ? t : [t]).flatMap(m);
|
|
149
|
+
if (!e.length) throw new Error("No sound source provided.");
|
|
150
|
+
if (e.length === 1 || !c) return e[0].src;
|
|
151
|
+
const n = document.createElement("audio");
|
|
152
|
+
let r = null;
|
|
153
|
+
for (const i of e) {
|
|
154
|
+
const a = i.type ?? y(i.src);
|
|
155
|
+
if (!a) continue;
|
|
156
|
+
const s = n.canPlayType(a);
|
|
157
|
+
if (s === "probably") return i.src;
|
|
158
|
+
s === "maybe" && r === null && (r = i.src);
|
|
159
|
+
}
|
|
160
|
+
return r ?? e[0].src;
|
|
161
|
+
}, v = class extends EventTarget {
|
|
162
|
+
#t = null;
|
|
163
|
+
#i = null;
|
|
164
|
+
#r;
|
|
165
|
+
#n;
|
|
166
|
+
#a;
|
|
167
|
+
#s;
|
|
168
|
+
#c;
|
|
169
|
+
#u = 0;
|
|
170
|
+
#e = null;
|
|
171
|
+
#o = !1;
|
|
172
|
+
constructor({ src: t, volume: e = 1, muted: n = !1, throttle: r = 0, pitchVariation: i = 0, preload: a = !1, debug: s = !1 }) {
|
|
173
|
+
super(), this.#r = d(e), this.#n = n, this.#a = Math.max(0, r), this.#s = Math.min(1, Math.max(0, i)), this.#c = s;
|
|
57
174
|
try {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, o.start(0);
|
|
62
|
-
} catch (e) {
|
|
63
|
-
throw this.debug, new Error(`Something went wrong while playing audio: ${e.message}`);
|
|
175
|
+
this.#t = f(t);
|
|
176
|
+
} catch (h) {
|
|
177
|
+
this.#i = h;
|
|
64
178
|
}
|
|
179
|
+
o.prime(), o.onUnlock(() => this.#h("unlock")), a && this.preload();
|
|
65
180
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const e = Date.now();
|
|
69
|
-
e - this.lastClickTime >= this.throttle && (t().catch((o) => {
|
|
70
|
-
this.debug;
|
|
71
|
-
}), this.lastClickTime = e);
|
|
72
|
-
};
|
|
181
|
+
static unlock() {
|
|
182
|
+
o.prime(), o.unlock();
|
|
73
183
|
}
|
|
74
|
-
|
|
75
|
-
|
|
184
|
+
static get unlocked() {
|
|
185
|
+
return o.unlocked;
|
|
186
|
+
}
|
|
187
|
+
get volume() {
|
|
188
|
+
return this.#r;
|
|
189
|
+
}
|
|
190
|
+
get muted() {
|
|
191
|
+
return this.#n;
|
|
192
|
+
}
|
|
193
|
+
async preload() {
|
|
194
|
+
if (!(this.#o || !this.#t))
|
|
195
|
+
try {
|
|
196
|
+
const t = await o.decode(this.#t);
|
|
197
|
+
return this.#h("load", t), t;
|
|
198
|
+
} catch (t) {
|
|
199
|
+
this.#l(t);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
unlock() {
|
|
204
|
+
o.unlock();
|
|
205
|
+
}
|
|
206
|
+
setVolume(t) {
|
|
207
|
+
this.#r = d(t), this.#e && !this.#n && this.#d(this.#r);
|
|
208
|
+
}
|
|
209
|
+
setMuted(t) {
|
|
210
|
+
this.#n = t, this.#e && this.#d(t ? 0 : this.#r), t || o.unlock();
|
|
211
|
+
}
|
|
212
|
+
toggleMuted() {
|
|
213
|
+
return this.setMuted(!this.#n), this.#n;
|
|
214
|
+
}
|
|
215
|
+
async play(t) {
|
|
216
|
+
if (this.#o) return;
|
|
217
|
+
const e = Date.now();
|
|
218
|
+
if (e - this.#u < this.#a) return;
|
|
219
|
+
this.#u = e, o.unlock();
|
|
220
|
+
let n;
|
|
76
221
|
try {
|
|
77
|
-
|
|
78
|
-
} catch (
|
|
79
|
-
|
|
80
|
-
|
|
222
|
+
n = t ? f(t) : this.#f();
|
|
223
|
+
} catch (r) {
|
|
224
|
+
this.#l(r);
|
|
225
|
+
return;
|
|
81
226
|
}
|
|
82
|
-
const o = this.throttleFn(() => this.playAudio(e));
|
|
83
227
|
try {
|
|
84
|
-
o();
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this
|
|
228
|
+
const r = await o.decode(n), i = o.context();
|
|
229
|
+
if (!i || this.#o) return;
|
|
230
|
+
i.state !== "running" && await i.resume().catch(u);
|
|
231
|
+
const a = this.#m(i), s = i.createBufferSource();
|
|
232
|
+
s.buffer = r, this.#s > 0 && (s.playbackRate.value = Math.max(0.5, 1 + (Math.random() * 2 - 1) * this.#s)), s.connect(a), this.#h("play"), await new Promise((h) => {
|
|
233
|
+
s.onended = () => {
|
|
234
|
+
s.disconnect(), h();
|
|
235
|
+
}, s.start(0);
|
|
236
|
+
}), this.#h("end");
|
|
237
|
+
} catch (r) {
|
|
238
|
+
this.#l(r);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
on(t, e) {
|
|
242
|
+
const n = (r) => e(r.detail);
|
|
243
|
+
return this.addEventListener(t, n), () => this.removeEventListener(t, n);
|
|
244
|
+
}
|
|
245
|
+
once(t, e) {
|
|
246
|
+
const n = (r) => e(r.detail);
|
|
247
|
+
this.addEventListener(t, n, { once: !0 });
|
|
248
|
+
}
|
|
249
|
+
destroy() {
|
|
250
|
+
this.#o || (this.#o = !0, this.#e?.disconnect(), this.#e = null);
|
|
251
|
+
}
|
|
252
|
+
#f() {
|
|
253
|
+
if (this.#t) return this.#t;
|
|
254
|
+
throw this.#i ?? /* @__PURE__ */ new Error("No valid sound source.");
|
|
255
|
+
}
|
|
256
|
+
#m(t) {
|
|
257
|
+
return (!this.#e || this.#e.context !== t) && (this.#e = t.createGain(), this.#e.gain.value = this.#n ? 0 : this.#r, this.#e.connect(t.destination)), this.#e;
|
|
258
|
+
}
|
|
259
|
+
#d(t) {
|
|
260
|
+
const e = this.#e;
|
|
261
|
+
if (!e) return;
|
|
262
|
+
const n = e.context.currentTime;
|
|
263
|
+
e.gain.cancelScheduledValues(n), e.gain.setValueAtTime(e.gain.value, n), e.gain.linearRampToValueAtTime(t, n + 0.015);
|
|
264
|
+
}
|
|
265
|
+
#h(t, e) {
|
|
266
|
+
if (typeof CustomEvent < "u") this.dispatchEvent(new CustomEvent(t, { detail: e }));
|
|
267
|
+
else if (typeof Event < "u") {
|
|
268
|
+
const n = new Event(t);
|
|
269
|
+
n.detail = e, this.dispatchEvent(n);
|
|
88
270
|
}
|
|
89
271
|
}
|
|
90
|
-
|
|
272
|
+
#l(t) {
|
|
273
|
+
this.#c, this.#h("error", t);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
91
276
|
export {
|
|
92
|
-
|
|
277
|
+
v as ClickTone
|
|
93
278
|
};
|
|
279
|
+
|
|
280
|
+
//# sourceMappingURL=index.es.js.map
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(a,c){typeof exports=="object"&&typeof module<"u"?c(exports):typeof define=="function"&&define.amd?define(["exports"],c):(a=typeof globalThis<"u"?globalThis:a||self,c(a.ClickTone={}))})(this,function(a){Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});var c=["pointerdown","pointerup","touchstart","touchend","keydown"],w={mp3:"audio/mpeg",m4a:"audio/mp4",mp4:"audio/mp4",aac:"audio/aac",oga:"audio/ogg",ogg:"audio/ogg",opus:"audio/ogg; codecs=opus",wav:"audio/wav",webm:"audio/webm",flac:"audio/flac"},h=typeof window<"u"&&typeof document<"u",l=()=>{},f=t=>!Number.isFinite(t)||t<0?0:t>1?1:t,y=class{#t=null;#r=!1;#i=!1;#n=null;#a=new Map;#s=new Set;get unlocked(){return this.#r}prime(){this.#i||!h||(this.#i=!0,this.#e(),this.#o())}context(){if(this.#t||!h)return this.#t;const t=window.AudioContext??window.webkitAudioContext;if(!t)return null;try{this.#t=new t({latencyHint:"interactive"})}catch{this.#t=new t}return this.#t}unlock(){const t=this.context();if(t){if(t.state==="running"){this.#c();return}t.resume().then(()=>this.#c()).catch(l)}}onUnlock(t){if(this.#r){t();return}this.#s.add(t)}decode(t){const e=this.#a.get(t);if(e)return e;const n=this.context();if(!n)return Promise.reject(new Error("Web Audio API is not available."));const i=(async()=>{const r=await fetch(t);if(!r.ok)throw new Error(`Failed to fetch "${t}": ${r.status} ${r.statusText}`);return n.decodeAudioData(await r.arrayBuffer())})();return this.#a.set(t,i),i.catch(()=>this.#a.delete(t)),i}#c(){if(this.#r)return;this.#r=!0,this.#u(),this.#n?.(),this.#n=null;const t=[...this.#s];this.#s.clear(),t.forEach(e=>{e()})}#u(){const t=this.#t;if(t)try{const e=t.createBuffer(1,1,Math.max(22050,t.sampleRate)),n=t.createBufferSource();n.buffer=e;const i=t.createGain();i.gain.value=1e-5,n.connect(i),i.connect(t.destination),n.start(0),n.stop(0)}catch{}}#e(){const t={passive:!0,capture:!0},e=()=>this.unlock();c.forEach(n=>{window.addEventListener(n,e,t)}),this.#n=()=>{c.forEach(n=>{window.removeEventListener(n,e,t)})}}#o(){const t=()=>{document.hidden||!this.#r||this.#t?.resume().catch(l)};document.addEventListener("visibilitychange",t)}},s=new y,v=t=>{const e=t.split(/[?#]/,1)[0];return w[e.slice(e.lastIndexOf(".")+1).toLowerCase()]},m=t=>{if(typeof t=="string")return[{src:t}];if(t instanceof URL)return[{src:t.href}];if(h&&t instanceof HTMLSourceElement){if(!t.src)throw new Error('<source> element has no "src" attribute.');return[{src:t.src,type:t.type||void 0}]}if(h&&t instanceof HTMLAudioElement){const e=Array.from(t.querySelectorAll("source")).filter(n=>n.src).map(n=>({src:n.src,type:n.type||void 0}));if(e.length)return e;if(t.src)return[{src:t.src}];throw new Error("<audio> element has no playable sources.")}if(typeof t=="object"&&t!==null&&"id"in t){if(!h)throw new Error("Cannot resolve element by id outside the DOM.");const e=document.getElementById(String(t.id));if(!e)throw new Error(`No element found with id "${t.id}".`);if(e instanceof HTMLSourceElement||e instanceof HTMLAudioElement)return m(e);throw new Error(`Element with id "${t.id}" is not a <source> or <audio> element.`)}if(typeof t=="object"&&t!==null&&"src"in t){if(!t.src)throw new Error('Source descriptor has an empty "src".');return[{src:t.src,type:t.type}]}throw new Error("Invalid sound source.")},p=t=>{const e=(Array.isArray(t)?t:[t]).flatMap(m);if(!e.length)throw new Error("No sound source provided.");if(e.length===1||!h)return e[0].src;const n=document.createElement("audio");let i=null;for(const r of e){const u=r.type??v(r.src);if(!u)continue;const o=n.canPlayType(u);if(o==="probably")return r.src;o==="maybe"&&i===null&&(i=r.src)}return i??e[0].src},g=class extends EventTarget{#t=null;#r=null;#i;#n;#a;#s;#c;#u=0;#e=null;#o=!1;constructor({src:t,volume:e=1,muted:n=!1,throttle:i=0,pitchVariation:r=0,preload:u=!1,debug:o=!1}){super(),this.#i=f(e),this.#n=n,this.#a=Math.max(0,i),this.#s=Math.min(1,Math.max(0,r)),this.#c=o;try{this.#t=p(t)}catch(d){this.#r=d}s.prime(),s.onUnlock(()=>this.#h("unlock")),u&&this.preload()}static unlock(){s.prime(),s.unlock()}static get unlocked(){return s.unlocked}get volume(){return this.#i}get muted(){return this.#n}async preload(){if(!(this.#o||!this.#t))try{const t=await s.decode(this.#t);return this.#h("load",t),t}catch(t){this.#l(t);return}}unlock(){s.unlock()}setVolume(t){this.#i=f(t),this.#e&&!this.#n&&this.#d(this.#i)}setMuted(t){this.#n=t,this.#e&&this.#d(t?0:this.#i),t||s.unlock()}toggleMuted(){return this.setMuted(!this.#n),this.#n}async play(t){if(this.#o)return;const e=Date.now();if(e-this.#u<this.#a)return;this.#u=e,s.unlock();let n;try{n=t?p(t):this.#f()}catch(i){this.#l(i);return}try{const i=await s.decode(n),r=s.context();if(!r||this.#o)return;r.state!=="running"&&await r.resume().catch(l);const u=this.#m(r),o=r.createBufferSource();o.buffer=i,this.#s>0&&(o.playbackRate.value=Math.max(.5,1+(Math.random()*2-1)*this.#s)),o.connect(u),this.#h("play"),await new Promise(d=>{o.onended=()=>{o.disconnect(),d()},o.start(0)}),this.#h("end")}catch(i){this.#l(i)}}on(t,e){const n=i=>e(i.detail);return this.addEventListener(t,n),()=>this.removeEventListener(t,n)}once(t,e){const n=i=>e(i.detail);this.addEventListener(t,n,{once:!0})}destroy(){this.#o||(this.#o=!0,this.#e?.disconnect(),this.#e=null)}#f(){if(this.#t)return this.#t;throw this.#r??new Error("No valid sound source.")}#m(t){return(!this.#e||this.#e.context!==t)&&(this.#e=t.createGain(),this.#e.gain.value=this.#n?0:this.#i,this.#e.connect(t.destination)),this.#e}#d(t){const e=this.#e;if(!e)return;const n=e.context.currentTime;e.gain.cancelScheduledValues(n),e.gain.setValueAtTime(e.gain.value,n),e.gain.linearRampToValueAtTime(t,n+.015)}#h(t,e){if(typeof CustomEvent<"u")this.dispatchEvent(new CustomEvent(t,{detail:e}));else if(typeof Event<"u"){const n=new Event(t);n.detail=e,this.dispatchEvent(n)}}#l(t){this.#c,this.#h("error",t)}};a.ClickTone=g});
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=index.umd.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clicktone",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0-dev.0",
|
|
4
|
+
"description": "A lightweight helper for UI sound feedback. It wraps the Web Audio API with a tiny, event-based API and a rock-solid iOS/Safari unlock.",
|
|
5
5
|
"author": "ux-ui.pro",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -13,46 +13,56 @@
|
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://github.com/ux-ui-pro/clicktone",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
+
"type": "module",
|
|
17
|
+
"packageManager": "yarn@1.22.22",
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
},
|
|
16
21
|
"scripts": {
|
|
17
22
|
"clean": "rimraf dist",
|
|
18
23
|
"build": "vite build",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"lint:fix": "
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"verify": "yarn build && yarn lint && yarn typecheck && yarn test:unit && yarn test:smoke",
|
|
26
|
+
"lint": "biome check src",
|
|
27
|
+
"lint:fix": "biome check --write src",
|
|
28
|
+
"format": "biome format --write src",
|
|
29
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
30
|
+
"test:unit": "vitest run --environment jsdom tests/unit",
|
|
31
|
+
"test:smoke": "node --test tests/*.js",
|
|
32
|
+
"prepublishOnly": "yarn clean && yarn verify"
|
|
23
33
|
},
|
|
24
|
-
"source": "src/
|
|
34
|
+
"source": "src/main.ts",
|
|
25
35
|
"main": "dist/index.cjs.js",
|
|
26
36
|
"module": "dist/index.es.js",
|
|
27
37
|
"browser": "./dist/index.umd.js",
|
|
28
38
|
"types": "dist/index.d.ts",
|
|
29
39
|
"exports": {
|
|
30
40
|
".": {
|
|
31
|
-
"
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
32
42
|
"import": "./dist/index.es.js",
|
|
43
|
+
"require": "./dist/index.cjs.js",
|
|
33
44
|
"default": "./dist/index.umd.js"
|
|
34
45
|
},
|
|
35
46
|
"./dist/*": "./dist/*"
|
|
36
47
|
},
|
|
37
48
|
"files": [
|
|
38
|
-
"dist/"
|
|
49
|
+
"dist/index.es.js",
|
|
50
|
+
"dist/index.cjs.js",
|
|
51
|
+
"dist/index.umd.js",
|
|
52
|
+
"dist/index.d.ts",
|
|
53
|
+
"README.md",
|
|
54
|
+
"LICENSE"
|
|
39
55
|
],
|
|
40
56
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"globals": "16.0.0",
|
|
51
|
-
"prettier": "3.5.3",
|
|
52
|
-
"rimraf": "6.0.1",
|
|
53
|
-
"typescript": "5.8.2",
|
|
54
|
-
"vite": "6.2.1",
|
|
55
|
-
"vite-plugin-dts": "4.5.3"
|
|
57
|
+
"@biomejs/biome": "2.4.15",
|
|
58
|
+
"@types/node": "25.5.0",
|
|
59
|
+
"esbuild": "0.28.0",
|
|
60
|
+
"jsdom": "27.0.1",
|
|
61
|
+
"rimraf": "6.1.3",
|
|
62
|
+
"typescript": "6.0.3",
|
|
63
|
+
"vite": "8.0.14",
|
|
64
|
+
"vite-plugin-dts": "5.0.1",
|
|
65
|
+
"vitest": "3.2.4"
|
|
56
66
|
},
|
|
57
67
|
"keywords": [
|
|
58
68
|
"MP3",
|