Skip to content

Commit 1f236cf

Browse files
Try-catch on deserialize.
1 parent a4c513e commit 1f236cf

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

samples/KristofferStrube.Blazor.WebAudio.WasmExample/Pages/Panning.razor

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ else
2727

2828
<div style="height: 30vh;">
2929
<SVGEditor @ref=sVGEditor
30-
Input=@input
31-
InputUpdated="(string s) => { input = s; StateHasChanged(); }"
32-
SupportedElements="supportedElements"
33-
InputRendered="EditorLoaded"
34-
DisableContextMenu="true"
35-
DisableBoxSelection="true" />
30+
Input=@input
31+
InputUpdated="(string s) => { input = s; StateHasChanged(); }"
32+
SupportedElements="supportedElements"
33+
InputRendered="EditorLoaded"
34+
DisableContextMenu="true"
35+
DisableBoxSelection="true" />
3636
</div>
3737

3838
<h3>Left speaker</h3>
@@ -105,13 +105,18 @@ else
105105

106106
while (true)
107107
{
108-
await leftAnalyzerNode.GetByteTimeDomainDataAsync(leftTimeDomainDataArray);
109-
await Task.Delay(10);
110-
leftTimeDomainMeasurements = await leftTimeDomainDataArray.GetAsArrayAsync();
108+
try
109+
{
110+
await leftAnalyzerNode.GetByteTimeDomainDataAsync(leftTimeDomainDataArray);
111+
leftTimeDomainMeasurements = await leftTimeDomainDataArray.GetAsArrayAsync();
111112

112-
await rightAnalyzerNode.GetByteTimeDomainDataAsync(rightTimeDomainDataArray);
113-
await Task.Delay(10);
114-
rightTimeDomainMeasurements = await rightTimeDomainDataArray.GetAsArrayAsync();
113+
await rightAnalyzerNode.GetByteTimeDomainDataAsync(rightTimeDomainDataArray);
114+
rightTimeDomainMeasurements = await rightTimeDomainDataArray.GetAsArrayAsync();
115+
}
116+
catch
117+
{
118+
119+
}
115120

116121
await Task.Delay(10);
117122
StateHasChanged();

samples/KristofferStrube.Blazor.WebAudio.WasmExample/wwwroot/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
5151
<link href="css/app.css" rel="stylesheet" />
5252
<link rel="icon" type="image/png" href="favicon.png" />
53-
<link href="KristofferStrube.Blazor.WebAudio.WasmExample.styles.css" rel="stylesheet" />
5453
<link href="_content/BlazorColorPicker/colorpicker.css" rel="stylesheet" />
5554
<link href="_content/Blazor.ContextMenu/blazorContextMenu.min.css" rel="stylesheet" />
5655
<link href="_content/KristofferStrube.Blazor.SVGEditor/kristofferStrubeBlazorSVGEditor.css" rel="stylesheet" />
56+
<link href="KristofferStrube.Blazor.WebAudio.WasmExample.styles.css" rel="stylesheet" />
5757
</head>
5858

5959
<body>

0 commit comments

Comments
 (0)