Coder Social home page Coder Social logo

Why write to temp file? about sox-stream HOT 3 CLOSED

artskydj avatar artskydj commented on May 24, 2024
Why write to temp file?

from sox-stream.

Comments (3)

ArtskydJ avatar ArtskydJ commented on May 24, 2024

Good question. I wish it worked consistently without the temp file. However, sox has issues reading from a piped stream sometimes. I think certain formats just didn't work without a temp file.

If I recall correctly, FLAC or MP3 had issues when being piped in w/o a temp file.

from sox-stream.

tasinet avatar tasinet commented on May 24, 2024

Thanks! I realised this yesterday: I added buffers on another implementation that works with in-memory streams and hit the same problem (FLAC corruption). WAV works thankfully, so I can still use it. Any idea what the underlying cause may be?

from sox-stream.

ArtskydJ avatar ArtskydJ commented on May 24, 2024

I don't think there's a good way for sox to handle streams in all cases.

For efficiency/performance reasons, sox can't buffer the entire file.

  • Without the entire file, you might lose some metadata in the ID3 tags, or equivalent in whatever format you use. I would hope that the metadata could be buffered.
  • Without the entire file, (again, depending on the format) you might not know how long the input is. But maybe you need to write the length to the beginning/head of the output file.

These are just guesses.

from sox-stream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.