Next on the list is correcting the incomplete types
This commit is contained in:
parent
4b664c69f7
commit
a8c44364e5
|
@ -304,11 +304,11 @@ void FAudio_Output::close()
|
||||||
|
|
||||||
if (sVoice) {
|
if (sVoice) {
|
||||||
if (playing) {
|
if (playing) {
|
||||||
HRESULT hr = sVoice->Stop(0);
|
HRESULT hr = sVoice->FAudioSourceVoice_Stop(0);
|
||||||
assert(hr == S_OK);
|
assert(hr == S_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
sVoice->DestroyVoice();
|
sVoice->FAudioVoice_DestroyVoice();
|
||||||
sVoice = NULL;
|
sVoice = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,12 +318,12 @@ void FAudio_Output::close()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mVoice) {
|
if (mVoice) {
|
||||||
mVoice->DestroyVoice();
|
mVoice->FAudioVoice_DestroyVoice();
|
||||||
mVoice = NULL;
|
mVoice = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (faud) {
|
if (faud) {
|
||||||
faud->Release();
|
FAudio_Release(faud);
|
||||||
faud = NULL;
|
faud = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ bool FAudio_Output::init(long sampleRate)
|
||||||
//#ifdef _DEBUG
|
//#ifdef _DEBUG
|
||||||
// flags = FAUDIO_DEBUG_ENGINE;
|
// flags = FAUDIO_DEBUG_ENGINE;
|
||||||
//#endif
|
//#endif
|
||||||
hr = FAudioCreate(&faud, flags);
|
hr = FAudioCreate(&faud, flags, FAUDIO_DEFAULT_CHANNELS);
|
||||||
|
|
||||||
if (hr != S_OK) {
|
if (hr != S_OK) {
|
||||||
wxLogError(_("The FAudio interface failed to initialize!"));
|
wxLogError(_("The FAudio interface failed to initialize!"));
|
||||||
|
@ -369,7 +369,7 @@ bool FAudio_Output::init(long sampleRate)
|
||||||
wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
|
wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
|
||||||
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
|
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
|
||||||
// create sound receiver
|
// create sound receiver
|
||||||
hr = faud->CreateMasteringVoice(
|
hr = faud->FAudio_CreateMasteringVoice(
|
||||||
&mVoice,
|
&mVoice,
|
||||||
FAUDIO_DEFAULT_CHANNELS,
|
FAUDIO_DEFAULT_CHANNELS,
|
||||||
FAUDIO_DEFAULT_SAMPLERATE,
|
FAUDIO_DEFAULT_SAMPLERATE,
|
||||||
|
@ -383,8 +383,10 @@ bool FAudio_Output::init(long sampleRate)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create sound emitter
|
// create sound emitter
|
||||||
hr = faud->CreateSourceVoice(&sVoice, &wfx, 0, 4.0f, ¬ify);
|
//This should be FAudio_CreateSourceVoice()
|
||||||
|
//hr = faud->CreateSourceVoice(&sVoice, &wfx, 0, 4.0f, ¬ify);
|
||||||
|
hr = faud->FAudio_CreateSourceVoice(&sVoice, &wfx, 0, 4.0f, ¬ify);
|
||||||
|
|
||||||
if (hr != S_OK) {
|
if (hr != S_OK) {
|
||||||
wxLogError(_("FAudio: Creating source voice failed!"));
|
wxLogError(_("FAudio: Creating source voice failed!"));
|
||||||
|
@ -493,7 +495,7 @@ bool FAudio_Output::init(long sampleRate)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matrixAvailable) {
|
if (matrixAvailable) {
|
||||||
hr = sVoice->SetOutputMatrix(NULL, 2, dd.OutputFormat.Format.nChannels, matrix);
|
hr = sVoice->FAudioVoice_SetOutputMatrix(NULL, 2, dd.OutputFormat.Format.nChannels, matrix);
|
||||||
assert(hr == S_OK);
|
assert(hr == S_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +503,7 @@ bool FAudio_Output::init(long sampleRate)
|
||||||
matrix = NULL;
|
matrix = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = sVoice->Start(0);
|
hr = sVoice->FAudioSourceVoice_Start(0);
|
||||||
assert(hr == S_OK);
|
assert(hr == S_OK);
|
||||||
playing = true;
|
playing = true;
|
||||||
currentBuffer = 0;
|
currentBuffer = 0;
|
||||||
|
@ -523,7 +525,7 @@ void FAudio_Output::write(uint16_t* finalWave, int length)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sVoice->GetState(&vState);
|
sVoice->FAudioSourceVoice_GetState(&vState);
|
||||||
assert(vState.BuffersQueued <= bufferCount);
|
assert(vState.BuffersQueued <= bufferCount);
|
||||||
|
|
||||||
if (vState.BuffersQueued < bufferCount) {
|
if (vState.BuffersQueued < bufferCount) {
|
||||||
|
@ -567,7 +569,7 @@ void FAudio_Output::pause()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (playing) {
|
if (playing) {
|
||||||
HRESULT hr = sVoice->Stop(0);
|
HRESULT hr = sVoice->FAudioSourceVoice_Stop(0);
|
||||||
assert(hr == S_OK);
|
assert(hr == S_OK);
|
||||||
playing = false;
|
playing = false;
|
||||||
}
|
}
|
||||||
|
@ -579,7 +581,7 @@ void FAudio_Output::resume()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!playing) {
|
if (!playing) {
|
||||||
HRESULT hr = sVoice->Start(0);
|
HRESULT hr = sVoice->FAudioSourceVoice_Start(0);
|
||||||
assert(hr == S_OK);
|
assert(hr == S_OK);
|
||||||
playing = true;
|
playing = true;
|
||||||
}
|
}
|
||||||
|
@ -591,12 +593,12 @@ void FAudio_Output::reset()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (playing) {
|
if (playing) {
|
||||||
HRESULT hr = sVoice->Stop(0);
|
HRESULT hr = sVoice->FAudioSourceVoice_Stop(0);
|
||||||
assert(hr == S_OK);
|
assert(hr == S_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
sVoice->FlushSourceBuffers();
|
sVoice->FlushSourceBuffers();
|
||||||
sVoice->Start(0);
|
sVoice->FAudioSourceVoice_Start(0);
|
||||||
playing = true;
|
playing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue