websockets-streaming-audio
Advanced tools
Comparing version 2.0.8 to 2.1.0
{ | ||
"name": "websockets-streaming-audio", | ||
"version": "2.0.8", | ||
"author": "Scott Stensland <scottstensland@gmail.com> (http://catfoodnation.com/)", | ||
"version": "2.1.0", | ||
"author": "Scott Stensland <scottstensland@gmail.com> ( https://stackoverflow.com/users/147175/scott-stensland )", | ||
"bugs": { | ||
@@ -9,12 +9,12 @@ "url": "https://github.com/scottstensland/websockets-streaming-audio/issues" | ||
"dependencies": { | ||
"ws": ">=7.2.1", | ||
"express": "^4.4.5", | ||
"ws": ">=8.8.0", | ||
"express": "^4.17.2", | ||
"audio-utils": "2.x.x", | ||
"shared-utils": "2.x.x", | ||
"bufferutil": "^4.0.1", | ||
"utf-8-validate": "^5.0.2" | ||
"bufferutil": "^4.0.6", | ||
"utf-8-validate": "^5.0.9" | ||
}, | ||
"description": "Click a browser button to launch a node.js process on the server side which streams audio using web sockets back to the browser which is then rendered using web audio API My plan is to make this modular enough to get added to your process as simple API calls", | ||
"engines": { | ||
"node": "12.14.0" | ||
"node": ">=v18.3.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "homepage": "https://github.com/scottstensland", |
@@ -72,11 +72,9 @@ websockets-streaming-audio | ||
```bash | ||
http://localhost:8888 | ||
``` | ||
http://localhost:8080 | ||
then click one of the stream buttons, after a song has played click reload before hitting another stream button - I am still learning front ends ;-) | ||
... OR ignore above and just see this app deployed live on heroku : | ||
... OR ignore above and just see this app deployed live on my vm: | ||
[https://fierce-waters-00266.herokuapp.com](https://fierce-waters-00266.herokuapp.com) | ||
[https://cybrcr.com/](https://cybrcr.com/) | ||
@@ -90,3 +88,3 @@ | ||
**Lessions Learned** | ||
**Lessons Learned** | ||
- to stream audio using Web Audio API you must offload your Web Socket calls to a Web Worker layer or else you will hear audible glitches when the single threaded browser is suddenly interrupted away from babysitting the audio rendering committments just to service responses received from the server side as sent using Web Socket | ||
@@ -93,0 +91,0 @@ - a stepping stone to above point : the browser wants its own buffer queue, do not short change the design by relying on a Web Worker buffer queue to directly supply Web Audio event loop callback demands for time critical fresh audio buffers or else responses back from the server will interrupt the audio playback |
@@ -19,3 +19,4 @@ | ||
var app = express(); | ||
var port = process.env.PORT || 8888; | ||
// var port = process.env.PORT || 8888; | ||
var port = process.env.PORT || 8080; | ||
@@ -51,2 +52,3 @@ // --- | ||
console.log("http server listening on %d", port); | ||
console.log("http://localhost:%d", port); | ||
@@ -53,0 +55,0 @@ |
@@ -5,4 +5,13 @@ | ||
// const ws_port = 8888 | ||
const ws_port = 8080 | ||
var ws_url = 'ws://localhost:' + ws_port | ||
console.log("\nhere is ws_url ", ws_url, "\n\n"); | ||
// const ws = new WebSocket('ws://www.host.com/path'); | ||
const ws = new WebSocket('ws://localhost:8080'); | ||
// const ws = new WebSocket('ws://localhost:8080'); | ||
const ws = new WebSocket( ws_url ); | ||
@@ -9,0 +18,0 @@ ws.on('open', function open() { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35466025
29
2416
99
Updatedbufferutil@^4.0.6
Updatedexpress@^4.17.2
Updatedutf-8-validate@^5.0.9
Updatedws@>=8.8.0