Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streams implementation #11

Open
rodrigourbinaiq opened this issue Jul 16, 2018 · 4 comments
Open

Streams implementation #11

rodrigourbinaiq opened this issue Jul 16, 2018 · 4 comments

Comments

@rodrigourbinaiq
Copy link

A streams implementation will be great!

@jankarres
Copy link
Member

Excuse my late reply, please.

I don't see any use case where streams in node-lame would help me. If you want to implement streams as an alternative to promises I'm looking forward to your pull request :)

@mnebuerquo
Copy link

mnebuerquo commented Apr 9, 2021

A use case for streams:

User is uploading recorded audio to send to google speech to transcribe as text.

  1. User device is IOS or Android, using react native. That is uploading an audio file (originally m4a on IOS).
  2. Server is Koa, and accepts a streaming upload as the request body (no multipart, just binary).
  3. Server wants to pipe ctx.req to the Google speech client. Unfortunately the encoding of the audio isn't what Google expects.

I want to insert a step 2a, in which ctx.req is piped to a transform which converts the audio format to a format Google accepts, then the transformed output is piped to the Google speech client.

The reason streams are important is that the server may not have a huge amount of memory or disk to work with. By streaming, we don't have to store the whole audio file in memory or on disk at once. This is even more important with many simultaneous requests.

@tombburnell
Copy link

Streams would be very useful for on-the-fly transcoding to avoid user having to wait for transcoding to buffer before downloading.

@YakovL
Copy link

YakovL commented Sep 28, 2023

I'd second the request (the use case is conversion of a big mp3 to wav and streaming it further to a sound recongnition library that uses streams). I wasn't sure if this is possible, but it seems it is, at least frame-by-frame (but I don't know yet whether a file typically consists of just one frame or many, i.e. does this provide enough fragmentation to do any real streaming)

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

No branches or pull requests

5 participants