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

Added a storing file example. #451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Ownezx
Copy link

@Ownezx Ownezx commented Oct 28, 2022

This is an example of loading files and playing them several times after reading issue #423. It would not make a lot of sense for larger audio as it is not streaming.

One downside of that is that, when adding operation to the saved file, the type becomes painfully long in rust as per the example : Buffered<TakeDuration<SkipDuration<Buffered<Decoder<BufReader<File>>>>>>.

I'm not really sure how to address that for now.

@dvdsk dvdsk force-pushed the master branch 3 times, most recently from b10961c to a7f67b3 Compare October 10, 2024 00:14
@dvdsk dvdsk force-pushed the master branch 4 times, most recently from 0ee0413 to 073fdb1 Compare November 8, 2024 00:55
@dvdsk
Copy link
Collaborator

dvdsk commented Nov 8, 2024

I'm not really sure how to address that for now.

I think you could solve that by putting the source in a Box. Then the type could be coerced to Box<dyn Source + Clone> using as Box<dyn Source + clone>. This comes at a slight performance cost. An alternative is not naming the entire type. Just: Buffered<_> might work.

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

Successfully merging this pull request may close these issues.

2 participants