<commit_before>#include "wiSound.h"

using namespace std;

wiAudioEngine* wiSoundEffect::audioEngine = nullptr;
wiAudioEngine* wiMusic::audioEngine = nullptr;


wiAudioEngine::wiAudioEngine()
{
	Initialize();
}
wiAudioEngine::~wiAudioEngine()
{
	if (pMasterVoice != nullptr) pMasterVoice->DestroyVoice();
	if (pXAudio2 != nullptr) pXAudio2->Release();
	SAFE_DELETE(pMasterVoice);
	SAFE_DELETE(pXAudio2);
	INITIALIZED = false;
}
HRESULT wiAudioEngine::Initialize()
{
	if (INITIALIZED)
		return S_OK;

	CoInitializeEx(NULL, COINIT_MULTITHREADED);

	HRESULT hr;
	pXAudio2 = nullptr;
	if (FAILED(hr = XAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR)))
		return hr;
	pMasterVoice = nullptr;
	if (FAILED(hr = pXAudio2->CreateMasteringVoice(&pMasterVoice)))
		return hr;

	INITIALIZED = true;
	return EXIT_SUCCESS;<commit_msg>sound fix<commit_after>#include "wiSound.h"

using namespace std;

wiAudioEngine* wiSoundEffect::audioEngine = nullptr;
wiAudioEngine* wiMusic::audioEngine = nullptr;


wiAudioEngine::wiAudioEngine()
{
	INITIALIZED = false;
	pXAudio2 = nullptr;
	pMasterVoice = nullptr;
	Initialize();
}
wiAudioEngine::~wiAudioEngine()
{
	if (pMasterVoice != nullptr) pMasterVoice->DestroyVoice();
	if (pXAudio2 != nullptr) pXAudio2->Release();
	SAFE_DELETE(pMasterVoice);
	SAFE_DELETE(pXAudio2);
	INITIALIZED = false;
}
HRESULT wiAudioEngine::Initialize()
{
	if (INITIALIZED)
		return S_OK;

	CoInitializeEx(NULL, COINIT_MULTITHREADED);

	HRESULT hr;
	pXAudio2 = nullptr;
	if (FAILED(hr = XAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR)))
		return hr;
	pMasterVoice = nullptr;
	if (FAILED(hr = pXAudio2->CreateMasteringVoice(&pMasterVoice)))
		return hr;

	INITIALIZED = true;
	return EXIT_SUCCESS;
{'fraction_non_alphanumeric': 0.12252042007001167, 'fraction_numerical': 0.011085180863477246, 'mean_word_length': 6.86697247706422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2064971', 'n_tokens_mistral': 657, 'n_tokens_neox': 626, 'n_words': 118}