Open stheine opened 5 years ago
I'm afraid that this module won't help you with this, you'll have to insert a Transform
stream between lame and speaker which does this at the raw audio bytes level:
const lame = require('lame')
const request = require('request')
const Speaker = require('speaker')
+const TempoModifier = require(...)
const decoder = new lame.Decoder()
+const tempo = new TempoModifier(1.10)
const speaker = new Speaker({
channels: 2,
bitDepth: 16,
sampleRate: 44100,
mode: lame.STEREO,
device: 'hw:1,0',
})
const req = request.get(url)
req
.pipe(decoder)
+ .pipe(tempo)
.pipe(speaker)
thanks for that info.
are you aware of any module that can be used as TempoModifier. or is that code that I/someone needs to write from scratch?
Not aware of any such module, but could potentially exist somewhere on npm ☺️
I am playing an audio PCM stream in javascript and would like to adjust the playback speed? how can I do this?
my relevant piece of code is:
So, for example, can I somehow speed up the playback to 10% or 20%?