Hi, I am developing an application for Symbol M9190 barcode scanner in VB.NET.
I am almost finished with the application, and now all I need is to control duration of the beep (or number of beeps) based on barcode symbology. Say, it will make one kind of beep for 1D barcode, and another for 2D.
I created a beeper object:
Dim NotificationDevices As Symbol.Notification.Device() = Symbol.Notification.Device.AvailableDevices()
For Each NotificationDevice As Symbol.Notification.Device In NotificationDevices
If NotificationDevice.ObjectType = Symbol.Notification.NotifyType.BEEPER Then
myBeeper = New Symbol.Notification.Beeper(NotificationDevice)
Exit For
End If
Next
And I am trying to control the beeper like this:
myBeeper.Duration = 1000
There are two problems.
First, assigning properties to myBeeper object does not seem to affect the actual sound that comes out.
Second, the scanner emits the sound before it raises the myReader_ReadNotify event, and so by the time I evaluate the encoding, the scanner has already beeped.
I could, possibly, mute the default beep, and force the scanner to emit the sound after I evaluate the data, but I do not see a beep event (or any other event) in the myBeeper object, and so I do not know how to force the scanner to emit the sound. But again, I do not know how to mute the beeper, and I do not know how to force the sound, so I am stuck.
Could you help me out please.
Thank you.
1 Replies
The scanner feedback parameters are what is causing the beep you are hearing now. This parameter is set before the barcode is scanned, so you will not be able to control it based on what type of barcode is decoded. As you have seen, that beep happens as soon as the scanner decodes the barcode (before the event is triggered). You can disable that and make your own sound if you want, but there will likely be a noticeable delay. What might be better is to try adding a second beep (or other sound) when you see that the barcode was a 2D. I have seen where customers use a second beep that is a different frequency to indicate something to the user.
If you want to disable the feedback beep, I think this would probably do it. You would do this after you create your reader and before you start a read.
myReader.Parameters.Feedback.Success.BeepTime = 0
If you want to play a sound on your own, look at the audiosample app on your PC. This shows how to do either a beep or play a wav file.
C:\Users\Public\Motorola EMDK for .NET\v2.9\Samples VS2008\VB\VB_AudioSample1
If you have problems playing a second sound after the original feedback sound, I seem to remember sometimes there being issues where the audio hardware might still be busy after doing the sound from the scanner, so would sometimes fail to play a second sound, but I think this might have only been if you use .wav file (not a beep).