Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: Timer in NAudio

$
0
0
zsb wrote:
djtechwork wrote:
Sorry, I new in vb.net. I've added 'InitializeComponent()' since the code gives me warning "should call InitializeComponent method." But I still can't get it worked well. In the database I put 3 data (08:00:00, 08:20:00, and 08:40:00). The sound play well when the timer match the 1st data (08:00:00), but not for the next two data. There's no sound at all

I would recommend that since you are new to vb.net to forget about using a database for now. Try using an array with the times you want to check for.

 

Dim timeArray() as String = {"08:00:00", "08:20:00", "08:04:00"}

 

Then simply loop through the array to check the time.

 

For c = 0 to timeArray.Count - 1
    If timeArray(c) = TimeofDay Then
       PlayBell()
    End If
Next c

 

 

 

On a side note, please remember we are here to help with NAudio(not with everything else)

Thanks for suggestion.

Sorry if my question isn't in proper place..


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>