mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Remove some duplicate code
This commit is contained in:
parent
45628316f8
commit
8a69f676ec
1 changed files with 3 additions and 18 deletions
|
@ -244,24 +244,6 @@ namespace MWSound
|
||||||
|
|
||||||
DecoderPtr SoundManager::loadVoice(const std::string &voicefile)
|
DecoderPtr SoundManager::loadVoice(const std::string &voicefile)
|
||||||
{
|
{
|
||||||
NameLoudnessMap::iterator lipiter = mVoiceLipBuffers.find(voicefile);
|
|
||||||
if(lipiter != mVoiceLipBuffers.end())
|
|
||||||
{
|
|
||||||
DecoderPtr decoder = getDecoder();
|
|
||||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
|
||||||
if(decoder->mResourceMgr->exists(voicefile))
|
|
||||||
decoder->open(voicefile);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::string file = voicefile;
|
|
||||||
std::string::size_type pos = file.rfind('.');
|
|
||||||
if(pos != std::string::npos)
|
|
||||||
file = file.substr(0, pos)+".mp3";
|
|
||||||
decoder->open(file);
|
|
||||||
}
|
|
||||||
return decoder;
|
|
||||||
}
|
|
||||||
|
|
||||||
DecoderPtr decoder = getDecoder();
|
DecoderPtr decoder = getDecoder();
|
||||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
||||||
if(decoder->mResourceMgr->exists(voicefile))
|
if(decoder->mResourceMgr->exists(voicefile))
|
||||||
|
@ -275,6 +257,9 @@ namespace MWSound
|
||||||
decoder->open(file);
|
decoder->open(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NameLoudnessMap::iterator lipiter = mVoiceLipBuffers.find(voicefile);
|
||||||
|
if(lipiter != mVoiceLipBuffers.end()) return decoder;
|
||||||
|
|
||||||
ChannelConfig chans;
|
ChannelConfig chans;
|
||||||
SampleType type;
|
SampleType type;
|
||||||
int srate;
|
int srate;
|
||||||
|
|
Loading…
Reference in a new issue