supersonic-scsynth-samples 0.2.2 → 0.3.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 +10 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,10 +10,13 @@ npm install supersonic-scsynth-samples
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**Important:** SuperSonic cannot be loaded from a CDN. You must self-host the core library and serve it with COOP/COEP headers. Samples can be loaded from a CDN.
|
|
14
|
+
|
|
15
|
+
### Self-hosted core with CDN samples
|
|
14
16
|
|
|
15
17
|
```javascript
|
|
16
|
-
|
|
18
|
+
// Self-hosted core library
|
|
19
|
+
import { SuperSonic } from './dist/supersonic.js';
|
|
17
20
|
|
|
18
21
|
const sonic = new SuperSonic({
|
|
19
22
|
sampleBaseURL: 'https://unpkg.com/supersonic-scsynth-samples@latest/samples/'
|
|
@@ -30,14 +33,15 @@ await sonic.allocReadBuffer(2, 'ambi_choir.flac');
|
|
|
30
33
|
sonic.send('/s_new', 'sonic-pi-basic_mono_player', -1, 0, 1, 'buf', 0);
|
|
31
34
|
```
|
|
32
35
|
|
|
33
|
-
###
|
|
36
|
+
### Self-hosted core and samples
|
|
37
|
+
|
|
38
|
+
Copy samples to your public directory and reference them locally:
|
|
34
39
|
|
|
35
40
|
```javascript
|
|
36
|
-
import { SuperSonic } from 'supersonic
|
|
37
|
-
import { SAMPLES_DIR } from 'supersonic-scsynth-samples';
|
|
41
|
+
import { SuperSonic } from './dist/supersonic.js';
|
|
38
42
|
|
|
39
43
|
const sonic = new SuperSonic({
|
|
40
|
-
sampleBaseURL:
|
|
44
|
+
sampleBaseURL: './samples/'
|
|
41
45
|
});
|
|
42
46
|
```
|
|
43
47
|
|