@ain1084/audio-worklet-stream 0.1.4 → 0.1.6

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.
Files changed (2) hide show
  1. package/README.md +23 -20
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -253,7 +253,7 @@ When using `@ain1084/audio-worklet-stream` in a Nuxt 3 project, you may encounte
253
253
 
254
254
  You can disable SSR for the component that uses the package. This can be done by using `<client-only>`:
255
255
 
256
- ```vue
256
+ ```
257
257
  <client-only>
258
258
  <MyComponent />
259
259
  </client-only>
@@ -290,36 +290,39 @@ export default defineNuxtConfig({
290
290
  ssr: false, // or use <client-only> for specific components
291
291
  vite: {
292
292
  optimizeDeps: {
293
- exclude: ['@ain1084/audio-worklet-stream'],
293
+ exclude: ['@ain1084/audio-worklet-stream']
294
294
  },
295
+ plugins: [
296
+ {
297
+ name: 'configure-response-headers',
298
+ configureServer: (server) => {
299
+ server.middlewares.use((_req, res, next) => {
300
+ res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp')
301
+ res.setHeader('Cross-Origin-Opener-Policy', 'same-origin')
302
+ next()
303
+ })
304
+ },
305
+ },
306
+ ],
295
307
  },
296
308
  nitro: {
297
309
  rollupConfig: {
298
310
  external: '@ain1084/audio-worklet-stream',
299
311
  },
300
- },
301
- // Ensure CORS settings for SharedArrayBuffer
302
- server: {
303
- headers: {
304
- 'Cross-Origin-Embedder-Policy': 'require-corp',
305
- 'Cross-Origin-Opener-Policy': 'same-origin',
312
+ // Ensure CORS settings for SharedArrayBuffer
313
+ routeRules: {
314
+ '/**': {
315
+ cors: true,
316
+ headers: {
317
+ 'Cross-Origin-Embedder-Policy': 'require-corp',
318
+ 'Cross-Origin-Opener-Policy': 'same-origin',
319
+ },
320
+ },
306
321
  },
307
322
  },
308
323
  })
309
324
  ```
310
325
 
311
- ### Future Plans and Known Issues
312
-
313
- #### Future Plans
314
- 1. **Enhanced Documentation**: Improve the documentation with more examples and detailed explanations.
315
-
316
- #### Known Issues
317
- 1. **Buffer Underruns**: Occasional buffer underruns under heavy CPU load.
318
- 2. **Overhead at the Start of Playback**: The ring buffer is being generated each time. To mitigate this, we plan to add a simple memory management mechanism to reuse the memory allocated for the ring buffer.
319
- 3. **Overhead during Worker Playback**: It seems that the Worker is being loaded every time playback starts (although it hits the cache). We plan to cache the Worker in memory and reuse it.
320
-
321
- We are continuously working on these areas to improve the library. Contributions and suggestions are always welcome!
322
-
323
326
  ## Future Plans and Known Issues
324
327
 
325
328
  ### Future Plans
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ain1084/audio-worklet-stream",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",