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

better subarray support #2

Open
ssfrr opened this issue Mar 10, 2016 · 1 comment
Open

better subarray support #2

ssfrr opened this issue Mar 10, 2016 · 1 comment

Comments

@ssfrr
Copy link
Collaborator

ssfrr commented Mar 10, 2016

Currently you can use sub on a SampleBuf, but you lose all the samplerate information, unitful indexing, etc.

It seems like we could tweak SampleBuf to contain any AbstractArray, and add a definition for sub that gives you a new SampleBuf that wraps the view instead of a copy. Something like

sub(buf::SampleBuf, A...) = SampleBuf(sub(buf.data), samplerate(buf)) seems like it should be pretty close.

@haberdashPI
Copy link
Contributor

#44 takes care of much of this. I don't think using view (the new name for sub) works, but that should be easy to implement.

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

2 participants