UKnod 16 Newbie Poster

Thanks for everyones help on this.

UKnod 16 Newbie Poster

OK, After all that I finally (with the help of https://www.daniweb.com/members/815196/xrjf) worked it out so here is the simplified code to play two different sounds out of two different cards at the same time.

Imports NAudio
Imports NAudio.Wave
Public Class Form1

    Private mplayer1 As WaveOut
    Private mplayer2 As WaveOut
    Private filereader As AudioFileReader

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        filereader = New AudioFileReader("C:\first_track.mp3")
        mplayer1 = New WaveOut()
        mplayer1.DeviceNumber = 0
        mplayer1.Init(filereader)
        mplayer1.Play()

        filereader = New AudioFileReader("C:\second_track.mp3")
        mplayer2 = New WaveOut()
        mplayer2.DeviceNumber = 1
        mplayer2.Init(filereader)
        mplayer2.Play()

    End Sub
End Class
UKnod 16 Newbie Poster

Thanks for the code, does this mean devnum is the sound card that I want to use after selecting the combo box?

So how do I make it play the sound from that sound card.

By the way this is all from code, so I wont be using combo boxes etc.

Currently I have MPLAYER.Play()
Which I need it to come out of a different sound card.
I also want to be able to play two different sounds out of two different card at the same time

UKnod 16 Newbie Poster

Unfortunatly all in c# with no real corelation vb.

rproffitt commented: The library is for .NET apps. VB.NET is .NET. However I understand that people want code for their choice of .NET language. +16
UKnod 16 Newbie Poster

OK, got it all installed and using the following code:

filereader = New AudioFileReader("C:\Users\Geoff\Desktop\audio\Alice Cooper - Schools Out.mp3")
        MPLAYER.Init(filereader)
        MPLAYER.Play()

It plays perfect. Any idea how to change the sound card, I think its got something to do with waveout. but not sure on the actual command.

UKnod 16 Newbie Poster

I am using visual studio / basic 2019. using the windows media to play sounds (WMPLib.WindowsMediaPlayer).
It works great, I can play multiple sounds etc. However what I realy want to do is play some sounds on sound card A. And other sounds in sound card B.
I am thinking that changing the default sound card, then playing the sound, then changing the defualt sound card and playing another sound might be the way to go, but I think when the sound card changes all the currently playing sounds stop.
Has anyone got any ideas how to acheieve this.

UKnod 16 Newbie Poster

I solved this my self in the end. What you have to do is make a seperate function that contains a OleDb.OleDbCommandBuilder and an update comanad.
This then updates the real database and not the one loaded into memnory. Seems like an od way to do things but it works.

UKnod 16 Newbie Poster

I have a problem with retrieving data from access databse.
I make the connection and retrieve the data no problem. But when the data changes from another use of the database, I cannot get the new changed data without reloading the complete programme. Even repeating the load functions does not renew the data from the access data base.

Here is what I have got:

Public Class Form1
    Private comm As New CommManager()
    Private transType As String = String.Empty

    Dim inc As Integer
    Dim con As New OleDb.OleDbConnection
    Dim dbProvider As String
    Dim dbSource As String
    Dim laptimes As New DataSet

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
        dbSource = "Data Source = f:/HareHound riderinput local.mdb;"

        con.ConnectionString = dbProvider & dbSource

        con.Open()
        sql = "SELECT * FROM laptimes"

        da = New OleDb.OleDbDataAdapter(sql, con)
        da.Fill(laptimes, "HareHounds")

        con.Close()

    End Sub
Private Sub btnimportdata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnimportdata.Click
                CheckBox1.Checked = laptimes.Tables("HareHounds").Rows(0).Item(10)
    End Sub

I have tried everthing to get this very simple thing to work, but I am at a loss. Help would be largly apreciated.

riam.khalid.3 commented: how toget start with data base +0