Click here to Skip to main content
15,923,789 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Modifying variables on instantiated forms Pin
Christian Graus28-Nov-08 16:27
protectorChristian Graus28-Nov-08 16:27 
QuestionExceedZip file not coming with Icon Pin
indian14327-Nov-08 8:10
indian14327-Nov-08 8:10 
AnswerRe: ExceedZip file not coming with Icon Pin
Christian Graus27-Nov-08 15:50
protectorChristian Graus27-Nov-08 15:50 
GeneralRe: ExceedZip file not coming with Icon Pin
indian14327-Nov-08 19:20
indian14327-Nov-08 19:20 
GeneralRe: ExceedZip file not coming with Icon Pin
EliottA28-Nov-08 2:21
EliottA28-Nov-08 2:21 
GeneralRe: ExceedZip file not coming with Icon Pin
Dave Kreskowiak28-Nov-08 5:21
mveDave Kreskowiak28-Nov-08 5:21 
GeneralRe: ExceedZip file not coming with Icon Pin
EliottA28-Nov-08 5:38
EliottA28-Nov-08 5:38 
QuestionVisual Basic 2005/2008 and DirectSound Pin
Member 395054727-Nov-08 3:12
Member 395054727-Nov-08 3:12 
I have got a question about DirectSound that I hope someone can help me with. I have made a test application with three buttons and one label.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim _dev As Device = New Device
    _dev.SetCooperativeLevel(Me.Handle, CooperativeLevel.Priority)
    Dim BufferDesc As BufferDescription = New BufferDescription()
    BufferDesc.ControlVolume = True
    BufferDesc.GlobalFocus = True
    Dim TheSound As SecondaryBuffer = New SecondaryBuffer("C:\Test.wav", BufferDesc, _dev)
    TheSound.Volume = -500
    TheSound.Play(0, BufferPlayFlags.Looping)
End Sub


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    My.Computer.Audio.Play("C:\Test.wav", AudioPlayMode.Background)
End Sub


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    For I = 1 To 100000
        Label1.Text = I.ToString
        Application.DoEvents()
    Next
End Sub



Now if I run the application and I press Button1 and then I press Button3 right after the sound stops. If I instead press Button2 and then Button3 the sound continues.

So my question is how can I make the DirectSound continue playing a sound without getting interupted when other code is executed?

Thanks in advance!
AnswerRe: Visual Basic 2005/2008 and DirectSound Pin
Christian Graus27-Nov-08 16:06
protectorChristian Graus27-Nov-08 16:06 
GeneralRe: Visual Basic 2005/2008 and DirectSound Pin
Member 395054727-Nov-08 22:34
Member 395054727-Nov-08 22:34 
AnswerRe: Visual Basic 2005/2008 and DirectSound Pin
Tom Deketelaere28-Nov-08 0:10
professionalTom Deketelaere28-Nov-08 0:10 
GeneralRe: Visual Basic 2005/2008 and DirectSound Pin
Member 395054728-Nov-08 5:19
Member 395054728-Nov-08 5:19 
AnswerI still need help Pin
Marty7828-Nov-08 6:44
Marty7828-Nov-08 6:44 
GeneralRe: I still need help Pin
Dave Kreskowiak28-Nov-08 11:41
mveDave Kreskowiak28-Nov-08 11:41 
QuestionPrevent exe from being copied and run on another pc Pin
Anoop Brijmohun27-Nov-08 1:58
Anoop Brijmohun27-Nov-08 1:58 
AnswerRe: Prevent exe from being copied and run on another pc Pin
Tom Deketelaere27-Nov-08 2:18
professionalTom Deketelaere27-Nov-08 2:18 
GeneralRe: Prevent exe from being copied and run on another pc Pin
Anoop Brijmohun27-Nov-08 20:29
Anoop Brijmohun27-Nov-08 20:29 
AnswerRe: Prevent exe from being copied and run on another pc Pin
Ashfield27-Nov-08 2:50
Ashfield27-Nov-08 2:50 
GeneralRe: Prevent exe from being copied and run on another pc Pin
EliottA27-Nov-08 2:58
EliottA27-Nov-08 2:58 
GeneralRe: Prevent exe from being copied and run on another pc Pin
Ashfield27-Nov-08 3:42
Ashfield27-Nov-08 3:42 
GeneralRe: Prevent exe from being copied and run on another pc Pin
Paul Conrad27-Nov-08 5:12
professionalPaul Conrad27-Nov-08 5:12 
GeneralRe: Prevent exe from being copied and run on another pc Pin
Ashfield27-Nov-08 8:31
Ashfield27-Nov-08 8:31 
GeneralRe: Prevent exe from being copied and run on another pc Pin
Paul Conrad27-Nov-08 9:05
professionalPaul Conrad27-Nov-08 9:05 
GeneralRe: Prevent exe from being copied and run on another pc Pin
Ashfield27-Nov-08 11:26
Ashfield27-Nov-08 11:26 
GeneralRe: Prevent exe from being copied and run on another pc Pin
Anoop Brijmohun27-Nov-08 20:39
Anoop Brijmohun27-Nov-08 20:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.