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

Support Audio Capture in AudioCallbacks #673

Merged
merged 3 commits into from
Jul 9, 2017

Conversation

shybyte
Copy link
Contributor

@shybyte shybyte commented Jun 13, 2017

  • Added open_capture method to AudioSubsystem
  • Added example audio-capture-and-replay

* Added open_capture method to AudioSubsystem
* Added example audio-capture-and-replay
@shybyte
Copy link
Contributor Author

shybyte commented Jun 13, 2017

@Cobrand This PR aims at solving #625 at least partly.

I know it's not perfect:

  • Audio Capture is only implemented for AudioCallbacks but not for open_queue
  • It uses the same AudioCallback for capture like for playback which leads to an unnecessary &mut for the case of capture

But it works for my use cases, introduces only minimal changes and does not break the existing API . Considering that #646 might change anyway everything, I hope this PR is useful for now.

shybyte added 2 commits June 15, 2017 10:08
…ple in order to avoid problems with sound cards, which might not be able to record with 44100 hz.
@Cobrand
Copy link
Member

Cobrand commented Jun 18, 2017

Looks good to me. I need to test it more thoroughly before merging though, but it should be fine.

@Cobrand
Copy link
Member

Cobrand commented Jul 9, 2017

Wonderful job! Works perfectly on Linux, couldn't test it on Windows but I'm assuming it works correctly in Windows and OSX as well. Could you please confirm which platforms you have tested this on?

@Cobrand Cobrand merged commit 0e2ac14 into Rust-SDL2:master Jul 9, 2017
@shybyte
Copy link
Contributor Author

shybyte commented Jul 10, 2017

I must admit, that I have tested it only on Linux (Ubuntu 16.04.2 LTS, x86_64, i3 windowsmanager, ALSA).

@Cobrand
Copy link
Member

Cobrand commented Jul 10, 2017

It's supposed to be cross-platform, but even in the case it doesn't work with other platforms, I'm sure someone will raise an issue soon enough.

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