-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for Macbook Air, which only supports f32 sample type #1
Conversation
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My editor believes in newlines at the end of files, and I just gave up fighting it. Sorry!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newlines for the newline gods. It's okay :)
move |data: &mut [i16], info: &cpal::OutputCallbackInfo| { | ||
let mut audio_sink = audio_sink.lock().unwrap(); | ||
audio_sink.fill_sound_buffer(data, info); | ||
let stream = match s.config.sample_format() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno if there's a prettier/cleaner way to do this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't just good, it's good enough :).
(I should probably also mention that I've not tested this on hardware that supports i16 samples. Works for f32.) |
Sorry, I only noticed this PR now! I blame GitHub notifications. Let me take a look. |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newlines for the newline gods. It's okay :)
move |data: &mut [i16], info: &cpal::OutputCallbackInfo| { | ||
let mut audio_sink = audio_sink.lock().unwrap(); | ||
audio_sink.fill_sound_buffer(data, info); | ||
let stream = match s.config.sample_format() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't just good, it's good enough :).
Likewise, only just noticed your response. :) Cheers! |
cpal claims that Macbook Airs only support f32 sample type, so, uh, let's support it!
Prefer f32 on the grounds it's the app's native format, allows for better fidelity when shoveled through a mixer, etc.
I have no idea if you actually want to take PRs, but given I was hacking it up locally I might as well share it.
Nice little project!