{"id":6742,"date":"2021-02-13T11:38:45","date_gmt":"2021-02-13T11:38:45","guid":{"rendered":"https:\/\/max-drake.cc\/?p=6742"},"modified":"2021-02-13T11:38:45","modified_gmt":"2021-02-13T11:38:45","slug":"handheld-barcode-scanner-data-entry-with-ahks-part-3-text-to-speech-for-confirmation-of-input","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=6742","title":{"rendered":"Handheld Barcode Scanner &#038; Data Entry with AHK&#8217;s Part 3- Text to Speech for confirmation of input"},"content":{"rendered":"\n<p>I used sound frequencies to indicate input to different fields of the form. I demonstrated that to my daughter and she commented that it would be handy if it could tell you what had been scanned. I mentioned the <strong>SoundPlay<\/strong> function instead of the <strong>SoundBeep<\/strong> function, suggesting you could make small <strong>.wav<\/strong> files to play that had speech sounds of the terms used, and it could loop through what was scanned and play the appropriate file. <\/p>\n\n\n\n<p>But it got me thinking, I&#8217;d downloaded and played with <strong><a rel=\"noreferrer noopener\" href=\"http:\/\/capture2text.sourceforge.net\/\" target=\"_blank\">Capture2Text<\/a><\/strong> AHK app that allows you to extract text from an image, and as well, you can have the text read to you. <strong>MAKE SURE YOU UNBLOCK THE DOWNLOADED ZIP FILE<\/strong> before unzipping otherwise the .DLL files will all be blocked and the programme wont work correctly.<\/p>\n\n\n\n<p>So I looked up a Text to Speech Go to (<strong><a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/redirect?event=video_description&amp;redir_token=QUFFLUhqbDU4bkNNZzhaZ01DZGZfbXhnYTBIWlV1RmlrUXxBQ3Jtc0ttSXZkSFRPSVpGelJNZG9aanFSYTdUS3NzRkg4UUtYQTlFT3d3YTZyOVZjSVVIWFZzS2NUdkRST0ZQSXp4d1BZX1dnTXUwSXFlM2hEeUJBVGtaQTBKZ21SUWtzNDBtTlVaQWxnV0JBdGp4Ujh0dlJLQQ&amp;q=https%3A%2F%2Fwww.autohotkey.com%2Fboards%2Fviewtopic.php%3Ff%3D6%26t%3D12304\" target=\"_blank\">https:\/\/www.autohotkey.com\/boards\/vie&#8230;<\/a>\u200b<\/strong>) to see script for AHK TextToSpeech class code. I then added this to my script. <\/p>\n\n\n\n<p>The video below explains the process:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"AHK scanner process with Text to Speech\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/aL04FbJMxI0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>I was very happy with the results, you can <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/drive.google.com\/file\/d\/1EJ-lOK9nrBwT9vXKHLucjxEvC6Clazs6\/view\" target=\"_blank\">download the AHK script here<\/a><\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Barcode scanner too far from dongle<\/h3>\n\n\n\n<p>So after getting that to work I started wondering about what happens when you are too far away from the dongle on the PC?  So you are scanning and it doesn&#8217;t reach the Pc. <\/p>\n\n\n\n<p>The scanner I have has a<strong> Storage mode<\/strong> that allows you to store information in the barcode reader and then send it to the dongle later. I saw somewhere that it can store up to <strong>50,000 scans <\/strong>before its full. That is a lot. <\/p>\n\n\n\n<p>So testing the storage mode out, I had to scan a QR code that set the scanner to <strong>StorageMode<\/strong> and then the scanner vibrated on each scan. It carried on vibrating when there was a successful scan. <\/p>\n\n\n\n<p> I then opened an Excel worksheet, put the cursor in the first cell , and scanned an <strong>Upload Data<\/strong> QR code to the scanner. It just did one line of data that tabbed across cells and put each separate scan in the adjoining cell. <\/p>\n\n\n\n<p>I then tried it with Notepad++ and Scanned <strong>Upload Data <\/strong>QR code and it sent the scans to the text file, but the space between each successive scan was not consistent. Some had a space between them and others joined together, so saving as a .TXT, .CSV or a .TSV file format made no difference, the data was not regularly spaced, and importing it into Excel sometimes 2 to 3 barcodes were all in the same cell. <\/p>\n\n\n\n<p>So the moral to the story, for my particular scanner, upload to an excel spreadsheet (then you can save to .CSV file or .XLS file. <\/p>\n\n\n\n<p>You do need to <strong>Clear Data<\/strong> (by scanning a specific QR code)  after upload, otherwise that stored data will be downloaded in next <strong>upload Data<\/strong> scan .<\/p>\n\n\n\n<p><strong>Row requirements<\/strong><\/p>\n\n\n\n<p>As the barcode data just comes out all on one row, you need to set up a AHK script that will break the file down to 3 scans (plant_ID, condition, Height) and then move the rest of the data down to a new line, so restructure the file data so that its compatible with the data going straight from scanner to Dongle. <\/p>\n\n\n\n<p>You will most probably have to have a pop-up box to say how many scans to a row, so that it restructures the file correctly, so the information can be appended to the original file. <\/p>\n\n\n\n<p>I haven&#8217;t done this yet, but its an idea in the works. I want to be able to go outside to my external plants and that is too far away from PC (although I could take it as tablet only out there. <\/p>\n\n\n\n<p>So, good to learn the foibles of the scanner. I&#8217;ll need to do a script that will manage this method of data collection. <\/p>\n\n\n\n<p><strong>Date\/Time\/User<\/strong><\/p>\n\n\n\n<p>Also you need to upload it straight away so that you have correct date\/time of when the scans occurred and also add user data to the script too. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">End comment<\/h3>\n\n\n\n<p>I got a little distracted when testing Storage mode on scanner because I wanted to try out the NFC (near Field Communication) sensor on my new phone and that started another thread. I&#8217;m starting to write a post on that. <\/p>\n\n\n\n<p>The Storage Mode extends the usefulness of the barcode scanner, but I think, if you are having to use it in this mode a lot I&#8217;d look at having the tablet on a strap with the dongle in it instead.  The reasoning with this is that with dongle close by its scan and go. With Storage mode you have to do post-processing to reorganise and append data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I used sound frequencies to indicate input to different fields of the form. I demonstrated that to my daughter and she commented that it would be handy if it could tell you what had been scanned. I mentioned the SoundPlay function instead of the SoundBeep function, suggesting you could make small .wav files to play [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6734,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[204,42],"tags":[],"class_list":["post-6742","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automation","category-productivity"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/02\/IMG20210207201007-600x400.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/02\/IMG20210207201007-600x600.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/6742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6742"}],"version-history":[{"count":0,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/6742\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/6734"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}