Skip to content

Apply playback factor on startup, pass Volume and recalculate ByteLimits #11

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

Merged
merged 3 commits into from
Mar 1, 2024
Merged
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/api/SnapOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class SnapOutput : public AudioInfoSupport {
/// mute / unmute
void setMute(bool mute) {
is_mute = mute;
vol_stream.setVolume(mute ? 0 : vol);
vol_stream.setVolume(mute ? 0 : vol * vol_factor);
audioWriteSilence();
}

Expand Down Expand Up @@ -153,6 +153,7 @@ class SnapOutput : public AudioInfoSupport {
vol_cfg.copyFrom(audio_info);
vol_cfg.allow_boost = true;
vol_stream.begin(vol_cfg);
vol_stream.setVolume(vol * vol_factor);

// open final output
out->setAudioInfo(audio_info);
Expand Down Expand Up @@ -246,8 +247,10 @@ class SnapOutput : public AudioInfoSupport {
} else {
// wait for the audio to become valid
ESP_LOGI(TAG, "starting after %d ms", delay_ms);
setPlaybackFactor(p_snap_time_sync->getFactor());
// replaced delay(delay_ms); with timed_stream
timed_stream.setStartMs(delay_ms);
timed_stream.begin();
is_sync_started = true;
result = true;
}
Expand Down