Skip to content

Streaming audio with http api request #77

Open
@VictorKolb

Description

@VictorKolb

Hello! Thanks for cool library! I have newbie question:
Is it possible to streaming audio from supercolliderjs with http api request?

If I have simple mp3 file I can do something like this:

app.get("/api/audiofile", (req, res) => {
    const filePath = path.resolve("example/file.mp3");
    const stat = fs.statSync(filePath);

    res.writeHead(200, {
        "Content-Type": "audio/mpeg",
        "Content-Length": stat.size,
    });

    const readStream = fs.createReadStream(filePath);
    readStream.pipe(res);
});

I trying naudiodon, but I guess it not right solution

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions