[修复]1. 修复加载时长的返回错误

This commit is contained in:
Blank 2024-11-09 16:35:18 +08:00
parent 123a5efcc3
commit 00d520cc03
1 changed files with 2 additions and 3 deletions

View File

@ -461,8 +461,7 @@ namespace GameFrameX.Sound
{
if (m_PlaySoundFailureEventHandler != null)
{
PlaySoundFailureEventArgs playSoundFailureEventArgs =
PlaySoundFailureEventArgs.Create(newSerialId, soundAssetName, soundGroupName, playSoundParams, errorCode.Value, errorMessage, userData);
PlaySoundFailureEventArgs playSoundFailureEventArgs = PlaySoundFailureEventArgs.Create(newSerialId, soundAssetName, soundGroupName, playSoundParams, errorCode.Value, errorMessage, userData);
m_PlaySoundFailureEventHandler(this, playSoundFailureEventArgs);
// ReferencePool.Release(playSoundFailureEventArgs);
@ -483,7 +482,7 @@ namespace GameFrameX.Sound
void OnAssetOperationHandleOnCompleted(AssetHandle assetHandle)
{
var assetObject = assetHandle.GetAssetObject<AudioClip>();
LoadAssetSuccessCallback(soundAssetName, assetObject, assetObject.length, PlaySoundInfo.Create(newSerialId, soundGroup, playSoundParams, userData));
LoadAssetSuccessCallback(soundAssetName, assetObject, assetHandle.Duration, PlaySoundInfo.Create(newSerialId, soundGroup, playSoundParams, userData));
}
assetOperationHandle.Completed += OnAssetOperationHandleOnCompleted;