DirectSound, multiple sounds in vb .net

Rintaro
09-05-2005, 11:03 PM
hi guys,
i'm pretty much a noob at vb and so im having probs getting mutliple sounds 2 play thru directsound. basically my program is a mix machine which plays sounds on keypress then records what youve done.

any help is very much appreciated as i've been running into brick walls all over the net =/

thx, Rin.

*i've been reading up a bit more and i need 2 create multiple sound buffers, and i tried 'my' version of multiple buffers
Public Class Form1
Inherits System.Windows.Forms.Form
Private _dev As Device
Private _dev1 As Device
Private _buffer As SecondaryBuffer
Private _buffer2 As SecondaryBuffer

Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
_dev = New Device
_dev.SetCooperativeLevel(Me.Handle, CooperativeLevel.Priority)
_dev1 = New Device
_dev1.SetCooperativeLevel(Me.Handle, CooperativeLevel.Priority)
End Sub

but it only seemed 2 result in the buffer containing the last selected file. (theyre selected using an open file dialog that sets the buffer
Private Sub btnSelFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelFile.Click
If ofd.ShowDialog Then
_buffer = New SecondaryBuffer(ofd.FileName, _dev)
End If
End Sub
Private Sub btnSelFile1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelFile1.Click
If ofd1.ShowDialog Then
_buffer2 = New SecondaryBuffer(ofd1.FileName, _dev1)
End If
End Sub

**found a resource that im finding hard 2 implement into this project http://www.springeronline.com/sgw/cda/pageitems/document/cda_downloaddocument/0,11996,0-0-45-88685-0,00.pdf
it has a method for multiple sound but i dont quite understand it...

ardman
11-09-2005, 01:15 AM
Why are you creating 2 devices? You don't need to create 2 devices in order to play multiple sounds.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum