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

Tell AudioOutputMixer the rate for the next sample #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/AudioOutputMixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ AudioOutputMixerStub::~AudioOutputMixerStub()

bool AudioOutputMixerStub::SetRate(int hz)
{
return parent->SetRate(hz, id);
myHz = hz;

return true;
}

bool AudioOutputMixerStub::SetBitsPerSample(int bits)
Expand All @@ -58,6 +60,7 @@ bool AudioOutputMixerStub::ConsumeSample(int16_t sample[2])
int16_t amp[2];
amp[LEFTCHANNEL] = Amplify(sample[LEFTCHANNEL]);
amp[RIGHTCHANNEL] = Amplify(sample[RIGHTCHANNEL]);
parent->SetRate(myHz);
return parent->ConsumeSample(amp, id);
}

Expand Down
1 change: 1 addition & 0 deletions src/AudioOutputMixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class AudioOutputMixerStub : public AudioOutput
protected:
AudioOutputMixer *parent;
int id;
int myHz;
};

// Single mixer object per output
Expand Down