Skip to content

Commit

Permalink
fix: 补充翻译,修复播放钢琴音没有应用总增益的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYunPlayer committed Aug 21, 2024
1 parent 6a399c6 commit 0db8a15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions TuneLab/Audio/AudioEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ public void Read(float[] buffer, int offset, int count)
mAudioGraph.MixData(position, endPosition, true, buffer, offset);
}
catch { }
if (MasterGain != 0)
{
float masterVolume = (float)MusicTheory.dB2Level(MasterGain);
int startIndex = offset;
int endIndex = offset + count * 2;
for (int i = startIndex; i < endIndex; i++)
{
buffer[i] *= masterVolume;
}
}
mGraphPosition = endPosition;
}
}
mAudioPlayer.AddData(count, buffer, offset);
if (MasterGain == 0)
return;

float masterVolume = (float)MusicTheory.dB2Level(MasterGain);
int startIndex = offset;
int endIndex = offset + count * 2;
for (int i = startIndex; i < endIndex; i++)
{
buffer[i] *= masterVolume;
}
}

public void Seek(double time)
Expand Down
1 change: 1 addition & 0 deletions TuneLab/Resources/Translations/zh-CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"Settings" = "设置"
"Please restart to apply settings." = "请重启以应用设置"
"Language" = "语言"
"Master Gain (dB)" = "总增益(分贝)"
"Custom Background Image" = "自定义背景图"
"Opacity" = "不透明度"
"Piano Key Samples" = "钢琴音采样"
Expand Down
2 changes: 1 addition & 1 deletion TuneLab/UI/Settings/SettingsWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public SettingsWindow()
panel.AddDock(slider, Dock.Right);
}
{
var name = new TextBlock() { Text = "Master Gain".Tr(this) + ": ", VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center };
var name = new TextBlock() { Text = "Master Gain (dB)".Tr(this) + ": ", VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center };
panel.AddDock(name);
}
listView.Content.Children.Add(panel);
Expand Down

0 comments on commit 0db8a15

Please sign in to comment.