Skip to content

Stopping track streams #38

@basvdheijden

Description

@basvdheijden

How do I properly close a playing stream returned from Track.prototype.play?

I'm building a cli-based mp3 player and wanted to start a new song. therefore I have to close the currently playing song. Tried track.end(); but then it takes a lot of time before ending the stream sequence. Is this due to the nature of the PassThrough stream implementation?

mpg123 = child_process.spawn('mpg123', ['-']);
track.play().pipe(mpg123.stdin);

setTimeout(function(){ track.end(); }, 5000); // Track ends after approx 15 secs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions