audiobits 0.1.1 → 0.1.2
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/CHANGELOG.md +6 -0
- package/README.md +11 -14
- package/dist/capabilities.json +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +3 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,14 +7,15 @@ Prerelease verification target: current Chromium. Other browsers and operating
|
|
|
7
7
|
systems are unverified and deliberately deferred. Maintainer listening acceptance for the
|
|
8
8
|
unchanged sound definitions is recorded separately.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Quick start
|
|
11
11
|
|
|
12
12
|
```sh
|
|
13
13
|
npm install audiobits
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Use a browser bundler
|
|
17
|
-
|
|
16
|
+
Use a browser bundler. Create the engine and sound once; run the final two lines
|
|
17
|
+
inside a user gesture handler, such as a button click. Call `audio.start()`
|
|
18
|
+
directly in that handler and await it before playback.
|
|
18
19
|
|
|
19
20
|
```ts
|
|
20
21
|
import { createAudio } from "audiobits";
|
|
@@ -22,19 +23,15 @@ import { confirmation } from "audiobits/recipes";
|
|
|
22
23
|
|
|
23
24
|
const audio = createAudio();
|
|
24
25
|
const sound = audio.sound(confirmation);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export function stop() {
|
|
30
|
-
audio.stopAll({ tails: "cut" });
|
|
31
|
-
}
|
|
32
|
-
export async function dispose() {
|
|
33
|
-
await audio.dispose();
|
|
34
|
-
}
|
|
26
|
+
|
|
27
|
+
await audio.start();
|
|
28
|
+
sound.play();
|
|
35
29
|
```
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
Surface activation failures and retry from a fresh gesture. Use
|
|
32
|
+
`audio.stopAll({ tails: "cut" })` to stop playback and `await audio.dispose()`
|
|
33
|
+
when the host is removed. See the production lifecycle example below for
|
|
34
|
+
hiding and navigation.
|
|
38
35
|
|
|
39
36
|
## Production lifecycle
|
|
40
37
|
|
package/dist/capabilities.json
CHANGED
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -11,7 +11,9 @@ package version and read `audiobits/capabilities.json` and
|
|
|
11
11
|
shipped behavior, not registry availability. Prerelease verification target: current Chromium. Other browsers and operating
|
|
12
12
|
systems are unverified and deliberately deferred.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Install with `npm install audiobits` and use a browser bundler. Follow the
|
|
15
|
+
[package quick start](../README.md#quick-start) to play the bundled `confirmation`
|
|
16
|
+
recipe with public imports from `audiobits` and `audiobits/recipes`. Create engines and
|
|
15
17
|
sounds without browser activation, then invoke `start()` synchronously inside
|
|
16
18
|
a user gesture and await it before `play()`. Surface failures and allow a fresh
|
|
17
19
|
gesture retry. Never queue playback across Stop, hiding, or disposal.
|