版本

menu_open
Wwise SDK 2018.1.11

◆ GetPlayingSegmentInfo()

AKRESULT __cdecl AK::MusicEngine::GetPlayingSegmentInfo ( AkPlayingID  in_PlayingID,
AkSegmentInfo out_segmentInfo,
bool  in_bExtrapolate = true 
)

Query information on the active segment of a music object that is playing. Use the playing ID that was returned from AK::SoundEngine::PostEvent(), provided that the event contained a play action that was targetting a music object. For any configuration of interactive music hierarchy, there is only one segment that is active at a time. To be able to query segment information, you must pass the AK_EnableGetMusicPlayPosition flag to the AK::SoundEngine::PostEvent() method. This informs the sound engine that the source associated with this event should be given special consideration because GetPlayingSegmentInfo() can be called at any time for this AkPlayingID. Notes:

  • If the music object is a single segment, you will get negative values for AkSegmentInfo::iCurrentPosition during the pre-entry. This will never occur with other types of music objects because the pre-entry of a segment always overlaps another active segment.
  • The active segment during the pre-entry of the first segment of a Playlist Container or a Music Switch Container is "nothing", as well as during the post-exit of the last segment of a Playlist (and beyond).
  • When the active segment is "nothing", out_uSegmentInfo is filled with zeros.
  • If in_bExtrapolate is true (default), AkSegmentInfo::iCurrentPosition is corrected by the amount of time elapsed since the beginning of the audio frame. It is thus possible that it slightly overshoots the total segment length.
    返回
    AK_Success if there is a playing music structure associated with the specified playing ID.
    参见
  • AK::SoundEngine::PostEvent
  • AkSegmentInfo
参数
in_PlayingID Playing ID returned by AK::SoundEngine::PostEvent().
out_segmentInfo Structure containing information about the active segment of the music structure that is playing.
in_bExtrapolate Position is extrapolated based on time elapsed since last sound engine update.

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅