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

Integrate decibel full scale to sample app. #6

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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
bin/
obj/
packages/
/Client/AppPackages/
/Client/BundleArtifacts/
*.suo
*.csproj.user
project.lock.json
Expand Down
7 changes: 5 additions & 2 deletions Client/Main/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
</ToggleButton>
</StackPanel>
</Border>
<Border Background="White" Width="110"
<Border Background="White" Width="auto"
RelativePanel.AlignBottomWithPanel="True"
RelativePanel.AlignLeftWithPanel="True"
Name="RemoteResFPSLabel">
Expand Down Expand Up @@ -250,13 +250,16 @@
RealTimePlayback="True"
Name="SelfVideo"
MediaFailed="SelfVideo_MediaFailed"/>
<Border Background="White" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="110">
<Border Background="White" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="auto">
<TextBlock Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="{Binding SelfWidth}"/>
<Run Text="x"/>
<Run Text="{Binding SelfHeight}"/>
<Run Text="@"/>
<Run Text="{Binding SelfVideoFps}"/>
<Run Text="_"/>
<Run Text="{Binding PeerAudioDbFullScale}"/>
<Run Text=" dBFS"/>
</TextBlock>
</Border>
</Grid>
Expand Down
21 changes: 21 additions & 0 deletions Client/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ public void Initialize(CoreDispatcher uiDispatcher)
});
};

DecibelFullScaleHelper.DecibelFullScaleComputed += (decibel) =>
{
RunOnUiThread(() =>
{
Debug.WriteLine(String.Format("{0} {1:N2}", DateTime.Now.ToString("mm:ss.fff"), decibel));
PeerAudioDbFullScale = String.Format("{0:N2}", decibel);
});
};


// Handler for Peer/Self video resolution changed event
ResolutionHelper.ResolutionChanged += (id, width, height) =>
{
Expand Down Expand Up @@ -1027,6 +1037,17 @@ public String PeerVideoFps
set { SetProperty(ref _peerVideoFps, value); }
}

private String _peerAudioDbFullScale;

/// <summary>
/// Decibel full scale of local microphone
/// </summary>
public String PeerAudioDbFullScale
{
get { return _peerAudioDbFullScale; }
set { SetProperty(ref _peerAudioDbFullScale, value); }
}

private String _selfVideoFps;

/// <summary>
Expand Down