Dim ad As Device '创建设备 Dim Buf As SecondaryBuffer '创建缓冲 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ad = New Device '实力化设备对象 ad.SetCooperativeLevel(Me.Handle, CooperativeLevel.Normal) '关联 Buf = New SecondaryBuffer("G:\MEDIA\WAV\ff9start.wav", ad) '实力化缓冲区 Buf.Play(0, BufferPlayFlags.Looping) '播放,同时指定开始位置跟方式 End Sub
Sticky 看原文吧:Buffers with \"sticky\" focus will continue to play if the user switches to another application not using DirectSound. However, if the user switches to another DirectSound application, all normal-focus and sticky-focus buffers in the previous application are muted.";
全局的:Buffers with global focus will continue to play if the user switches focus to another application, even if the new application uses DirectSound. The one exception is if you switch focus to a DirectSound application that uses the DSSCL_WRITEPRIMARY cooperative level. In this case, the global-focus buffers from other applications will not be audible.";
再就是 默认 硬件加速 软件加速 (用默认就好,有硬件就用硬件,否则模拟)
以下是原文: if (MixHardware) { sText = sText + "\n\nWith the hardware mixing flag, the new buffer will be forced to use hardware mixing. If the device does not support hardware mixing or if the required hardware resources are not available, the call to the DirectSound.CreateSoundBuffer method will fail."; } else if (MixSoftware) { sText = sText + "\n\nWith the software mixing flag, the new buffer will use software mixing, even if hardware resources are available."; } else { // Default mixing sText = sText + "\n\nWith default mixing, the new buffer will use hardware mixing if available, otherwise software mixing will be used."; }