Fixed incorrect file path of audio resource in AudioEngine on Android.

This commit is contained in:
Dhilan007 2014-10-21 18:34:05 +08:00
parent 8993e490e6
commit c66348435c
1 changed files with 3 additions and 3 deletions

View File

@ -217,7 +217,7 @@ bool AudioEngineImpl::init()
return ret;
}
int AudioEngineImpl::play2d(const std::string &fileFullPath ,bool loop ,float volume)
int AudioEngineImpl::play2d(const std::string &filePath ,bool loop ,float volume)
{
auto audioId = AudioEngine::INVAILD_AUDIO_ID;
@ -227,10 +227,10 @@ int AudioEngineImpl::play2d(const std::string &fileFullPath ,bool loop ,float vo
break;
auto& player = _audioPlayers[currentAudioID];
auto initPlayer = player.init( _engineEngine, _outputMixObject, fileFullPath, volume, loop);
auto initPlayer = player.init( _engineEngine, _outputMixObject, FileUtils::getInstance()->fullPathForFilename(filePath), volume, loop);
if (!initPlayer){
_audioPlayers.erase(currentAudioID);
log("%s,%d message:create player for %s fail", __func__, __LINE__, fileFullPath.c_str());
log("%s,%d message:create player for %s fail", __func__, __LINE__, filePath.c_str());
break;
}