Microsoft.DirectX.DirectSound.SecondaryBuffer.Clone Not woking

Answered Microsoft.DirectX.DirectSound.SecondaryBuffer.Clone Not woking

  • Sunday, April 29, 2012 3:58 PM
     
      Has Code

    Hi, how can i create a buffer with  BufferCaps.ControlEffects set to false in order to clone it? Here's the documentation

     Public AudioData(7, 15) As SecondaryBuffer
    
        Dim dev As New Device
        Public Sub LoadAllData(ByVal ph As IntPtr)
    
            dev.SetCooperativeLevel(ph, CooperativeLevel.Priority)
            For i As Integer = 0 To 7
                For j As Integer = 1 To 16
                    AudioData(i, j - 1) = New SecondaryBuffer(Audio.audioPlay.GetFileURL(i, j), dev)
                  
                Next
            Next
        End Sub
    
    
    
    Public Function GetAudioBuffer(ByVal i As Instruments, ByVal n As Byte, ByRef ndevice As Device) As SecondaryBuffer
            Return AudioData(i, n - 1).Clone(ndevice)
    End Function



    Muscalu Ștefan ~~~~ Student



All Replies

  • Sunday, April 29, 2012 4:59 PM
     
     Answered Has Code

    Found it

       Dim desc As New BufferDescription
       desc.ControlEffects = False
    
       ''''''
    
       AudioData(i, j - 1) = New SecondaryBuffer(Audio.audioPlay.GetFileURL(i, j), desc, AudioBuffers.Device)



    Muscalu Ștefan ~~~~ Student

  • Monday, April 30, 2012 1:18 PM
     
     
    conguratulations

    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.