gpt4 book ai didi

c# - 我如何设置带有低音的歌曲/文件结尾的回调?

转载 作者:行者123 更新时间:2023-11-30 16:34:53 25 4
gpt4 key购买 nike

我正在使用 Bass .我想设置一个回调,这样当歌曲结束时我可以直接播放另一首歌曲。

最佳答案

它不是 C#,但这里有一些您应该能够轻松转换的 VB.Net 代码:

设置回调

' Mixer handle to the bass synch callback when the current track in the mixer ends
Private m_MixerSynchProc As Un4seen.Bass.SYNCPROC
Private m_MixerSyncHandle As Int32 = 0

' Create a new callback for when the current track in the mixer has ended
m_MixerSynchProc = New Un4seen.Bass.SYNCPROC(AddressOf CurrentTrackEnded)

m_MixerSyncHandle = Bass.BASS_ChannelSetSync(m_MixerHandle, Un4seen.Bass.BASSSync.BASS_SYNC_END Or Un4seen.Bass.BASSSync.BASS_SYNC_MIXTIME, 0, m_MixerSynchProc, 0)

BASS 将在音轨结束时调用的委托(delegate)子

' Mixer sync proc callback for when the current track has ended
Private Sub CurrentTrackEnded(ByVal MixerHandle As Int32, ByVal Channel As Int32, ByVal Data As Int32, ByVal User As IntPtr)
' Do stuff here when the track ends
End Sub

关于c# - 我如何设置带有低音的歌曲/文件结尾的回调?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2263127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com