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

Buffer creation interface #83

Open
bramtayl opened this issue Aug 30, 2021 · 4 comments
Open

Buffer creation interface #83

bramtayl opened this issue Aug 30, 2021 · 4 comments

Comments

@bramtayl
Copy link
Member

Currently, if you want to write from a SampledSignal to PortAudio, you will end up maintaining two buffers. SampledSignals will make a buffer, PortAudio will make a buffer, and all data will be copied back and forth between these buffers. It seems possible for SampledSignals to just use the PortAudioBuffer. One way of doing this would be to have some sort of public interface, maybe a make_buffer function, that defaults to allocating a regular array. Then, PortAudio could overload that function and say "you can share my buffer".

@rob-luke
Copy link
Member

It seems possible for SampledSignals to just use the PortAudioBuffer

Are you implying that SampledSignals should have PortAudio as a dependency? SampledSignals has broad applications and is used beyond just audio, for example for neuroimaging signals. So I don't think it's appropriate to add PortAudio as a requirement.

Or are you suggesting some new API or functionality for SampledSignals?

@bramtayl
Copy link
Member Author

Or are you suggesting some new API or functionality for SampledSignals?

Yes, this one. Sorry if it wasn't clear.

@rob-luke
Copy link
Member

rob-luke commented Sep 1, 2021

It seems possible for SampledSignals to just use the PortAudioBuffer

Yeah I think I was confused by this sentence. I though you were implying that SampledSignals should use PortAudio output, which of course it cant, I dont want my EEG code having PortAudio as a dependency.

Ok so what exactly are you proposing as the change to SampledSignals? I think just keep in mind that the two projects are relatively independent, so it should have a general API.

@bramtayl
Copy link
Member Author

bramtayl commented Sep 1, 2021

Maybe something like a make_buffer function that defaults to this line:

buf = Array{eltype(source)}(undef, blocksize, nchannels(source))
and that sinks can overload?

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