mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
Print a bit more information for sound initialization
This commit is contained in:
parent
acd6d9cd72
commit
9dbb713b7c
2 changed files with 23 additions and 9 deletions
|
@ -594,6 +594,8 @@ bool OpenAL_Output::init(const std::string &devname, const std::string &hrtfname
|
||||||
{
|
{
|
||||||
deinit();
|
deinit();
|
||||||
|
|
||||||
|
std::cout<< "Initializing OpenAL..." <<std::endl;
|
||||||
|
|
||||||
mDevice = alcOpenDevice(devname.c_str());
|
mDevice = alcOpenDevice(devname.c_str());
|
||||||
if(!mDevice && !devname.empty())
|
if(!mDevice && !devname.empty())
|
||||||
{
|
{
|
||||||
|
@ -613,6 +615,12 @@ bool OpenAL_Output::init(const std::string &devname, const std::string &hrtfname
|
||||||
name = alcGetString(mDevice, ALC_DEVICE_SPECIFIER);
|
name = alcGetString(mDevice, ALC_DEVICE_SPECIFIER);
|
||||||
std::cout<< "Opened \""<<name<<"\"" <<std::endl;
|
std::cout<< "Opened \""<<name<<"\"" <<std::endl;
|
||||||
|
|
||||||
|
ALCint major=0, minor=0;
|
||||||
|
alcGetIntegerv(mDevice, ALC_MAJOR_VERSION, 1, &major);
|
||||||
|
alcGetIntegerv(mDevice, ALC_MINOR_VERSION, 1, &minor);
|
||||||
|
std::cout<< " ALC Version: "<<major<<"."<<minor<<"\n"<<
|
||||||
|
" ALC Extensions: "<<alcGetString(mDevice, ALC_EXTENSIONS) <<std::endl;
|
||||||
|
|
||||||
ALC.EXT_EFX = alcIsExtensionPresent(mDevice, "ALC_EXT_EFX");
|
ALC.EXT_EFX = alcIsExtensionPresent(mDevice, "ALC_EXT_EFX");
|
||||||
ALC.SOFT_HRTF = alcIsExtensionPresent(mDevice, "ALC_SOFT_HRTF");
|
ALC.SOFT_HRTF = alcIsExtensionPresent(mDevice, "ALC_SOFT_HRTF");
|
||||||
|
|
||||||
|
@ -665,6 +673,11 @@ bool OpenAL_Output::init(const std::string &devname, const std::string &hrtfname
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout<< " Vendor: "<<alGetString(AL_VENDOR)<<"\n"<<
|
||||||
|
" Renderer: "<<alGetString(AL_RENDERER)<<"\n"<<
|
||||||
|
" Version: "<<alGetString(AL_VERSION)<<"\n"<<
|
||||||
|
" Extensions: "<<alGetString(AL_EXTENSIONS)<<std::endl;
|
||||||
|
|
||||||
if(!ALC.SOFT_HRTF)
|
if(!ALC.SOFT_HRTF)
|
||||||
std::cout<< "HRTF status unavailable" <<std::endl;
|
std::cout<< "HRTF status unavailable" <<std::endl;
|
||||||
else
|
else
|
||||||
|
|
|
@ -56,8 +56,6 @@ namespace MWSound
|
||||||
, mUnderwaterSound(nullptr)
|
, mUnderwaterSound(nullptr)
|
||||||
, mNearWaterSound(nullptr)
|
, mNearWaterSound(nullptr)
|
||||||
{
|
{
|
||||||
std::cout<< "Initializing sound..." <<std::endl;
|
|
||||||
|
|
||||||
mMasterVolume = Settings::Manager::getFloat("master volume", "Sound");
|
mMasterVolume = Settings::Manager::getFloat("master volume", "Sound");
|
||||||
mMasterVolume = std::min(std::max(mMasterVolume, 0.0f), 1.0f);
|
mMasterVolume = std::min(std::max(mMasterVolume, 0.0f), 1.0f);
|
||||||
mSFXVolume = Settings::Manager::getFloat("sfx volume", "Sound");
|
mSFXVolume = Settings::Manager::getFloat("sfx volume", "Sound");
|
||||||
|
@ -82,13 +80,23 @@ namespace MWSound
|
||||||
mBufferCacheMin = std::min(mBufferCacheMin*1024*1024, mBufferCacheMax);
|
mBufferCacheMin = std::min(mBufferCacheMin*1024*1024, mBufferCacheMax);
|
||||||
|
|
||||||
if(!useSound)
|
if(!useSound)
|
||||||
|
{
|
||||||
|
std::cout<< "Sound disabled." <<std::endl;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string hrtfname = Settings::Manager::getString("hrtf", "Sound");
|
std::string hrtfname = Settings::Manager::getString("hrtf", "Sound");
|
||||||
int hrtfstate = Settings::Manager::getInt("hrtf enable", "Sound");
|
int hrtfstate = Settings::Manager::getInt("hrtf enable", "Sound");
|
||||||
HrtfMode hrtfmode = hrtfstate < 0 ? HrtfMode::Auto :
|
HrtfMode hrtfmode = hrtfstate < 0 ? HrtfMode::Auto :
|
||||||
hrtfstate > 0 ? HrtfMode::Enable : HrtfMode::Disable;
|
hrtfstate > 0 ? HrtfMode::Enable : HrtfMode::Disable;
|
||||||
|
|
||||||
|
std::string devname = Settings::Manager::getString("device", "Sound");
|
||||||
|
if(!mOutput->init(devname, hrtfname, hrtfmode))
|
||||||
|
{
|
||||||
|
std::cerr<< "Failed to initialize audio output, sound disabled" <<std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> names = mOutput->enumerate();
|
std::vector<std::string> names = mOutput->enumerate();
|
||||||
std::cout <<"Enumerated output devices:\n";
|
std::cout <<"Enumerated output devices:\n";
|
||||||
std::for_each(names.cbegin(), names.cend(),
|
std::for_each(names.cbegin(), names.cend(),
|
||||||
|
@ -97,13 +105,6 @@ namespace MWSound
|
||||||
);
|
);
|
||||||
std::cout.flush();
|
std::cout.flush();
|
||||||
|
|
||||||
std::string devname = Settings::Manager::getString("device", "Sound");
|
|
||||||
if(!mOutput->init(devname, hrtfname, hrtfmode))
|
|
||||||
{
|
|
||||||
std::cerr<< "Failed to initialize audio output, sound disabled" <<std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
names = mOutput->enumerateHrtf();
|
names = mOutput->enumerateHrtf();
|
||||||
if(!names.empty())
|
if(!names.empty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue