Skip to content

Serve sampled signals using InteractNext and Mux #40

@rob-luke

Description

@rob-luke

This might be way outside the scope of SampledSignals.jl, but I thought I would ask...

I would like to serve a web page that can play audio stored in a SampleBuf, similar to how you can press pause/play/stop etc in jupyter. Ideally the user could modify some parameters using interact.

Below is a minimum (not) working example. It runs and the generated web page has the interact buttons, but it shows an error saying SampleBuf display requires javascript. Do you know of a way to serve generated audio to a web page?

using InteractNext, WebIO, SampledSignals

Fs = 16000

ui = @manipulate for time_seconds = [1, 2, 3]
    x = randn(Fs * time_seconds, 2);  
    a = SampleBuf(x, Fs)
end

using Mux
responder(req) = ui
webio_serve(page("/", responder))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions