Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes

【Android】阅读Android源码时,发现Android获取音频时间的返回值是正常的;

【Wwise】使用SamplesPerFrame*NumberOfRefillsinVoice=512*2,48kHz的音乐,在UE中使用Runable开启多线程,每个音频帧内5次调用AK::MusicEngine::GetPlayingSegmentInfo,获取的音乐时间,会在2个音频帧交界位置出现回退的情况,是否每有对超出1个音频帧的音乐时间进行最大值调整?

 

// 获取音频时间

status_t MediaClock::getMediaTime_l(

        int64_t realUs, int64_t *outMediaUs, bool allowPastMaxTime) const {

    if (mAnchorTimeRealUs == -1) {

        return NO_INIT;

    }

    // 新音频时间=上次更新音频时间+系统时间差值

    int64_t mediaUs = mAnchorTimeMediaUs

            + (realUs - mAnchorTimeRealUs) * (double)mPlaybackRate;

    if (mediaUs > mMaxTimeMediaUs && !allowPastMaxTime) {

        // 牵制音频时间不超过音频帧

        mediaUs = mMaxTimeMediaUs;

    }

    if (mediaUs < mStartingTimeMediaUs) {

        mediaUs = mStartingTimeMediaUs;

    }

    if (mediaUs < 0) {

        mediaUs = 0;

    }

    *outMediaUs = mediaUs;

    return OK;

}

in General Discussion by Sico Y. (160 points)

Please sign-in or register to answer this question.

...