Author Archives: Walt Q.

Adding VoiceLabs to your Amazon Alexa Skills in C#

If you’re a C# programmer and have created Amazon Alexa Skills, you already know it’s tough to get some C# code samples, SDK’s and just a overall clear path to satisfy your curiosity for creating Alexa Skills. These days, it’s just tough to get C# support on a lot of the new services out there. We are just now seeing the big fish like Google and Amazon support C# on their cloud offerings which is great, but startups like VoiceLabs for instance, come out of the gate with SDK’s for Node.js, Python, Java and Ruby… no C#.

If you’re not familiar, VoiceLabs is a free analytics platform for Voice that supports Amazon Alexa, Google Home, Cortana and Siri. Actually, it supports just about any platform really. I have my API.ai chatbots logging on VoiceLabs right now, mainly just to see if I could. I just set my VoiceLabs project to Google Home and made a note in the metadata that says it’s really for API.ai, works for me!

So back to my SDKs rant, as I navigated their “Install SDK” section realizing no support for C# at the time of this writing, I figured, ok, nothing new, I’ll just write my own… again… just need to find the HTTP API documentation. After clicking on page after page and a couple of Google searches later, I could not find any information on any kind of HTTP API. At first I was upset, I mean who doesn’t post their HTTP API docs! Then, I took this as a challenge. Yes, I could of called or emailed, but no, that’s all too easy. I had to break down their Node.js SDK and figure it out for myself.

To make a long story short, here’s what I came up with. Works great on my machine…


var payload = new
{
app_token = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
user_hashed_id = MD5Hash(request.Session.User.UserId),
session_id = request.Session.SessionId,
intent = request.Request.Intent.Name,
data = new {
metadata = request.Request.Intent.Slots,
speech = response.response.outputSpeech.text
},
event_type = "SPEECH"
};

var data = JsonConvert.SerializeObject(payload);

using (var client = new WebClient())
{
client.Headers[HttpRequestHeader.ContentType] = "application/json";
client.UploadString("https://api.voicelabs.co/events/?sdk=n_1&auth_token=" + payload.app_token, data);
}

A couple of notes to consider when implementing the above code, first, get your “app_token” from VoiceLabs.co and replace the “XXX…” value. Then make sure that “request” is set to your AlexaRequest object. Resolve all usings for JsonConvert (Newtonsoft), WebClient and so on. Lastly, that MD5Hash is function I found online, can’t remember who or where I stole it from but this is what that looks like if you just want to steal it from here, have at it…


public static string MD5Hash(string text)
{
MD5 md5 = new MD5CryptoServiceProvider();
md5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(text));
byte[] result = md5.Hash;

StringBuilder strBuilder = new StringBuilder();
for (int i = 0; i < result.Length; i++)
{
strBuilder.Append(result[i].ToString("x2"));
}

return strBuilder.ToString();
}

So there you have it, drop that in your C# Alexa Skill, Google Assistant Action, API.ai chatbot or whatever else you have that handles logic for voice or chat intents.

Overall, despite it’s HTTP API & C# SDK shortcomings, VoiceLabs is a promising analytics platform for voice. Works fast and my intent requests are visualized instantly in the Voice Insights interface. I definitely recommend checking them out for yourself at http://voicelabs.co.

EDIT: I just chatted with Adam from VoiceLabs, cool dude! And yes, they do have information on their HTTP API, you just need to contact them to get it. I say, if you’re up for the challenge, let’s get some community supported open source SDKs going on Github for C#, Unity, C++ and whatever other language you want to support!

If you run into any problems hit me up on http://twitter.com/WaltQue and if you haven’t done so yet, check out my Pluralsight course on creating Alexa Skills in C#. It’s getting a bit dated but still plenty of relevant information. Enjoy!

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn

You’re invited to Intoxicating VR @ the MIC!

Intoxicating VR at the Microsoft Innovation Center

Please join us for an evening of Virtual Reality immersion with Industry professionals. Experience VR for yourself up close and personal. Learn about opportunities for developing with some of most talented Pixel Pathfinders in the area.

This event includes: Hands-on Demos • Food & Libations • VR Hardware

When: Thursday June 16 • 6:00 – 9:00 PM
Where: Microsoft Innovation Center
@Venture Hive
1010 NE 2nd Ave
Miami, FL 33132

Register Now to save your seat!

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn

South Florida Code Camp is almost here!

The South Florida Code Camp agenda has just been released. There’s 15 tracks with over 90 sessions. I will be speaking along with David Isbitski on Amazon Echo and Alexa in the IoT Track. In addition, there will be some great speakers that will touch on Cortana, Raspberry Pi, OpenBCI, C#, dotNET, node, Angular and many other topics so make sure to check out the agenda and register today. Already over 800 people have registered so make sure to get your free ticket before it’s too late!

Also! We will be hosting a min-hackathon and hands on labs with Raspberry Pi’s, Windows 10 and Amazon Echo, so make sure to come thru and hack away! Yes, there will be prizes like Pi’s and Echo!

Agenda: http://www.fladotnet.com/codecamp/Agenda.aspx

Registration: http://bit.ly/sfcc2016

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn

Pluralsight Offers Free Courses to Those Out of Work

Pluralsight, a global leader in online technology training has opened up 50 free courses to those unemployed and seeking to pivot into a new career in technology.

“Pluralsight is thrilled to partner with the White House to help unemployed Americans land a career in technology,” said Aaron Skonnard, founder and CEO of Pluralsight. “Online training is a great resource for people to learn at their own pace, making it a real possibility for those looking to master key technology skills in a rapidly growing job sector.”

Currently more than half a million jobs in information technology go unfilled in the United States alone. That makes this category the largest U.S. available jobs sector.

The 50 courses are broken down into 5 categories which include job-hunting skills, general technology basics, data skills, front-end web application development and IT operations.

To learn more about Pluralsight’s TechHire program visit https://learn.pluralsight.com/offers/tech-hire-signup.

Additional information about Pluralsight can be found at pluralsight.com.

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn

Enter the Matrix… IoT for Everyone!

matrix iot for everyoneNow here’s a Kickstarter campaign after my own heart. First, it’s called the “Matrix” (I know right!?!) Secondly, it’s an IoT product that could really make the Internet of Things accessible to everyone, as their slogan suggests. It’s basically a single unit, filled with 15 sensors, vision and voice interfaces, with plug-n-play architecture and an open framework for third party developers to enhance even further.

This thing needs to happen! Check it out…

For details go to https://www.kickstarter.com/projects/2061039712/matrix-the-internet-of-things-for-everyonetm

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn

Five Things Old Programmers Should Remember

Lately I’ve been feeling the aging process, both physically and mentally, a bit more than usual. It could be that the big 4-0 is around the corner for me and sitting on my ass coding for the last 20 years is finally catching up. I’ve never given it much thought as getting older is something we don’t have control over but it’s becoming more and more evident in my work that I take a little longer than usual to spit out those few extra lines of code. Maybe it’s just that I think it through more thoroughly now, not sure.

It’s also a bit disconcerting seeing all these programmers older than myself that just don’t code any more. They seem jaded to me, disgruntled, dazed and maybe even depressed. I definitely don’t want to end up like that! It’s in my nature to take things apart and put them back together, to build things, create things, improve things, program things. So as I get older, do I now have to constantly check in with myself and make sure I don’t sway from my chosen path?

In any case, I just read this post by Gary Wisniewski that got me to truly reflect on aging programmers such as myself, get back to basics and once again have fun with the craft I love… programming.

Thanks for the hope Gary!

Read Gary’s post on Medium @ https://medium.com/@garywiz/five-things-old-programmers-need-to-remember-e78caf0b0973

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn

New IoT Gateway on Kickstarter!

The Things GatewayThe much anticipated IoT Kickstarter campaign for The Things Network has finally launched! With a ridiculously low target price of $200 per 4 mile range, LoRa WAN gateway, not to mention it’s decentralized, open source and crowd sourced… these gateways will help smart city initiatives around the world push forward at an unprecedented pace.

The beauty of this IoT network is that it runs decentralized on the open spectrum of 433 mHz (US) so no need for Wi-Fi, Bluetooth and cellular connections. So imagine having 1,000 LoRa enabled devices spread across a 4 mile radius, all sending small packets of data back to your LoRa gateway/router. From there you can plug that data to the Internet for further processing or storage in the cloud.

The possibilities are endless. Go to http://thethingsnetwork.org/landing/kickstarter to learn more, support the cause and help create a smarter world one city at a time.

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedIn