cell update

This commit is contained in:
2026-01-06 20:30:49 -06:00
parent 63407ea722
commit 6e5c71b22d

View File

@@ -50,15 +50,21 @@
* .finish_hook- optional callback when voice finishes
*/
var wav = use('soundwave/wav')
var mp3 = use('soundwave/mp3')
var flac = use('soundwave/flac')
var dsp = use('soundwave/dsp')
var wav = use('wav')
var mp3 = use('mp3')
var flac = use('flac')
var dsp = use('dsp')
var samplerate = use('libsamplerate/convert')
var Blob = use('blob')
var soundwave = {}
var voice = {
stop() {
this.stopped = true
}
}
// Create a new audio player instance
soundwave.create = function(opts) {
opts = opts || {}
@@ -196,22 +202,22 @@ soundwave.create = function(opts) {
player.play = function(pcm, opts) {
if (!pcm) return null
var voice = {
var newvoice = meme(voice, {
source: pcm,
pos: 0,
vol: 1.0,
loop: false,
stopped: false,
finish_hook: null
}
})
if (opts) {
if (opts.loop != null) voice.loop = opts.loop
if (opts.vol != null) voice.vol = opts.vol
if (opts.loop != null) newvoice.loop = opts.loop
if (opts.vol != null) newvoice.vol = opts.vol
}
player.voices.push(voice)
return voice
player.voices.push(newvoice)
return newvoice
}
// Pull mixed audio frames