Results 1 to 6 of 6

Thread: Light Sensor and Audio Announcement

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2009
    Posts
    77

    Light Sensor and Audio Announcement

    Hello. I'm new at VB therefore i need some guidance on how to go about doing e current project that i have. Currently doing on Light Sensor and Audio Announcement.

    The project goes like this:

    1) I am suppose to record an audio then "stop and save".(Earlier on i'm required to create a timer to estimate time of audio, n i've already done so under timer3)

    2) When i select [in the coding, its declared as checkbox1] Monitor Light Intensity(Audio Alert), im also required to key in at the 'Threshold level' of 0.2V higher than the 'Voltage Level Representing Light Intensity'.

    3) Actually the project currently works like this. When i select Monitor Light Intensity(Audio Alert), key in at the "Threshold level" of 0.2V higher than the "Voltage Level Representing Light Intensity", then when i placed my hand over the sensor, the audio doesnt sound till i remove my hand from e sensor then e audio will sound.

    4) But my project requirement , requires to :
    (a) Play audio when hand is placed over sensor, and
    audio stops when hand is removed from sensor.
    (b) If audio is 30 sec, and my hand is placed over for 1 min, im required to replay e audio again.

    5) I am suppose to edit from the part shown below and also do something to the timer:

    If IsNumeric(TextBox1.Text) Then
    If CDbl(TextBoxVoltage.Text) > CDbl(TextBox1.Text) And Len(TextBox1.Text) <> 0 Then 'If light intensity is lower than level
    If CheckBox1.Checked = True Then

    Call PlayAudio() 'My.Computer.Audio.Play("D:\record.wav", AudioPlayMode.Background) <-- i'm required to edit from here

    End If

    6) I was wondering if i could add in :
    If Timer3.Interval = ? And ? Then
    Call PlayAudio() 'My.Computer.Audio.Play("D:\record.wav", AudioPlayMode.Background)

    Else : Call StopANDsave()

    End If

    I was wondering if this method will work? Because i am suppose to know and declare the Duration of the audio And Triggering point , then the audio will play out according to my project requirement.

    Attached is the GUI picture and coding of my project. Sorry, but this is my 1st time doing on visual basic therefore i may need some help and guidance on it . Thanks in advance. =)
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width