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

Document about available vs explicit buffer #77

Open
ewjmulder opened this issue Aug 14, 2018 · 0 comments
Open

Document about available vs explicit buffer #77

ewjmulder opened this issue Aug 14, 2018 · 0 comments

Comments

@ewjmulder
Copy link
Owner

    // TODO: Document decision: available() seems like a good candidate, but cannot be used in this case,
    // because AudioFloatInputStreamResampler will always return 0 (probably because trying to calculate any meaningful
    // value is quite hard given the different byte rates of the input and output streams).
    // Furthermore, available() is some kind of 'best guess' method that is not very reliable.
    // For instance, with Open microphone streams, it will show the amount of bytes for half a second as available,
    // even though in reality it's much more.

    // Anyway, there is a better option: always keep a little buffer ourselves that we can read from directly and
    // just refill in the background (other thread) when needed. That other thread may be blocking, no problem,
    // so no need to check available(), reading will be done when it's done.
    // Only downside is: no option to fill a step partly. Decision: when the custom buffer is not ready, too bad, we just take
    // only silence.
    // TODO: maybe differentiate for live / non-live? Both in buffer size / refill policy and what to do when empty / not ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant