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

add pitch / playback speed #50

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

RehkitzDev
Copy link

Absolute beginner in audio. Hope someone can approve.

@@ -212,17 +222,23 @@ impl Mixer {
let mut i = 0;

while let Some(sound) = self.mixer_state.get_mut(i) {
let pitch = sound.pitch;
let volume = sound.volume;
let mut remainder = buffer.len();

loop {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not quite sure if this is enough - from what I understand, without interpolation+some filtering, pitch by simple re-sampling with nearest neighbor scaling does not sound very good.

Also I am not sure if effects belong to the fill_audio_buffer function

Copy link
Author

@RehkitzDev RehkitzDev May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added linear interpolation between sample entries. I don't hear much of a difference.

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