Skip to content

Commit

Permalink
Move audio initiaziation into a thread scope to speed up loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
giladreich committed Jun 27, 2018
1 parent c7ccc5b commit a095c36
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/IHK.ResultsNotifier/Windows/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ private async void MainWindow_Load(object sender, EventArgs e)

TableData<string> resultsTable = await GetExamResults();
dashboard.TableData.Clone(resultsTable);

File.WriteAllBytes(FILE_SOUND_PATH, Resources.new_results_DE);
await Task.Run(() => audio.Init());
}

private async Task<TableData<string>> GetExamResults()
Expand Down Expand Up @@ -148,6 +145,10 @@ private async void StartListening()

if (!dashboard.TableData.SequenceEqual(newData))
{

File.WriteAllBytes(FILE_SOUND_PATH, Resources.new_results_DE);
await Task.Run(() => audio.Init());

dashboard.TableData.Clone(newData);
Log("Wohooo....New results are available!!!!!", Color.DarkGreen);
audio.Play();
Expand Down

0 comments on commit a095c36

Please sign in to comment.