<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Media;
using Xemio.GameLibrary.Common;

namespace Xemio.GameLibrary.Sound.Internal
{
    internal class InternalSound : ISound
    {
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="InternalSound"/> class.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        public InternalSound(string fileName)
        {
            string fullPath = Path.GetFullPath(fileName);
            UriBuilder builder = new UriBuilder(fullPath);

            ThreadInvoker.Invoke(() =>
            {
                //Safely create the media player inside the main thread to prevent
                //invoker exceptions using the play method.

                this.MediaPlayer = new MediaPlayer();
                this.MediaPlayer.Volume = 1.0f;
                this.MediaPlayer.Open(new Uri(builder.ToString()));

                while (this.MediaPlayer.IsBuffering);
            });
        }
        #endregion
<commit_msg>Prevented sounds from being played on application start.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Media;
using Xemio.GameLibrary.Common;

namespace Xemio.GameLibrary.Sound.Internal
{
    internal class InternalSound : ISound
    {
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="InternalSound"/> class.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        public InternalSound(string fileName)
        {
            string fullPath = Path.GetFullPath(fileName);
            UriBuilder builder = new UriBuilder(fullPath);

            ThreadInvoker.Invoke(() =>
            {
                //Safely create the media player inside the main thread to prevent
                //invoker exceptions using the play method.

                this.MediaPlayer = new MediaPlayer();
                this.MediaPlayer.Volume = 0.8f;
                this.MediaPlayer.Open(new Uri(builder.ToString()));
                this.MediaPlayer.Stop();

                while (this.MediaPlayer.IsBuffering);
            });
        }
        #endregion

{'fraction_non_alphanumeric': 0.09881756756756757, 'fraction_numerical': 0.0016891891891891893, 'mean_word_length': 2.0294117647058822, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2488085', 'n_tokens_mistral': 606, 'n_tokens_neox': 588, 'n_words': 160}