Need help with ytdl-core and ExpressJS

This page summarizes the projects mentioned and recommended in the original post on /r/learnjavascript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • captureSystemAudio

    Capture system audio ("What-U-Hear")

  • Sure, see https://github.com/guest271314/captureSystemAudio/blob/master/native_messaging/capture_system_audio/background.js, in pertinent part

  • lamejs

    mp3 encoder in javascript

  • `` async importEncoder() { if (this.mimeType.includes('mp3')) { const { lamejs } = await import(${this.src.origin}/lame.min.js`); this.mp3encoder = new lamejs.Mp3Encoder(2, 44100, 256); this.mp3controller = void 0; return this.mp3stream = new ReadableStream({ start: (_) => { return (this.mp3controller = _); }, }); } // ... } // ... write: async ({ timestamp }) => { const int8 = new Int8Array(441 * 4); const { value, done } = await this.inputReader.read(); if (!done) { int8.set(new Int8Array(value)); } else { console.log({ done }); return this.audioWriter.closed; } const int16 = new Int16Array(int8.buffer); // https://stackoverflow.com/a/35248852 const channels = [ new Float32Array(441), new Float32Array(441), ]; for (let i = 0, j = 0, n = 1; i < int16.length; i++) { const int = int16[i]; // If the high bit is on, then it is a negative number, and actually counts backwards. const float = int >= 0x8000 ? -(0x10000 - int) / 0x8000 : int / 0x7fff; // Deinterleave channels[(n = ++n % 2)][!n ? j++ : j - 1] = float; } // https://github.com/zhuker/lamejs/commit/e18447fefc4b581e33a89bd6a51a4fbf1b3e1660 const left = channels.shift(); const right = channels.shift(); let leftChannel, rightChannel; if (this.mimeType.includes('mp3')) { const sampleBlockSize = 441; leftChannel = new Int32Array(left.length); rightChannel = new Int32Array(right.length); for (let i = 0; i < left.length; i++) { leftChannel[i] = left[i] < 0 ? left[i] * 32768 : left[i] * 32767; rightChannel[i] = right[i] < 0 ? right[i] * 32768 : right[i] * 32767; } } // ... if (this.mimeType.includes('mp3')) { // Finish writing MP3 const mp3buf = this.mp3encoder.flush(); if (mp3buf.length > 0) { this.mp3controller.enqueue(new Uint8Array(mp3buf)); this.mp3controller.close(); } this.resolve(new Response(this.mp3stream).arrayBuffer()); }

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts