Tuesday, June 13, 2017

The non-skier parents guide with kids who ski

As a transplant to the Bay Area from tropical climes, I am not good at getting even to the 'abc' of skiing. But for some reason(well, not really unknown - thanks to some great friends!), our kids took to it and enjoy everything that comes with it. From the gear to the a·près-ski, they seem to enjoy the sights, sounds, company that comes with a ski trip to the Sierras.

One of the queries that I constantly get from parents who are as good as I am skiing and are transplants,is on how one equips and prepares for a ski season.

Most importantly, learn to have fun. As arm-chair analysts on how skiing is done, it was easy to nit-pick and point out where they might have been wrong with our kids, we've realized that its just easier to let them have fun and leave it to experience for the skills to flourish.

Over time, there are some small tips that we've figured out that helps save some time and money, and here they are. Note that some of them might work only for the Bay Area.

Equipment:

  • Skis & Poles: Best bargain would be the Sports Basement rental. If you see yourself making more than 4 trips in a season, the season lease would work out cheaper.
  • Boots: Probably the most important of equipment. We have been able to get by with the season-lease package from Sports Basement but do educate yourself on what is a good fit. Take time, ask questions, wear the right socks before you try them out. Here's a video from REI that could help.



  • Thermal Layers: Dress in layers. Watch out for post season deals, set up alerts in slickdeals.net, fatwallet.com etc so you are immediately alerted on a sale based on keywords.
  • Jackets: You could go from practical $30 Costco ones to $500 fancy ones. Our kids have found the Costco ones perfectly usable. The outlet stores also carry good jackets in the $50-$80 ranges. Again, use the power of internet and tools available to bargain hunt post season.
  • Gloves: HEAD from Costco. Seasonal, keep an eye out. If you missed it, slickdeals.net and fatwallet.com to the rescue.
  • Helmets: Started with Lucky Bums from Amazon and recently moved to Bolle from Costco.
  • Goggles: Look for ones with UV protection. If your kid wears glasses (and not contacts), look for ones that are marked 'OTG'(over the glasses goggles). Trust me, they will thank you.
Lift tickets:
  • Donner ski : Great place for beginners who are trying to figure out whether they like skiing or not. 
  • Costco: Diamond peak gift cards at 20% off. They are not available online and only in some of the stores.
  • All season: If you make more than 4 trips a season, this is a better value. One problem with this is, if you buy it for a smaller resort, you would be tied to the same set of slopes for the whole season. Which might not be a bad thing as the smaller resorts would have the smaller crowds. Good value: Sierra-at-Tahoe at South Lake Tahoe. From beginner to advanced skiers, there's something for everyone. Taking a season's pass with Vail gives you access to Northstar, Heavenly and Kirkwood. Watch out for blackout dates - if they mess with your plans to 4 trips, you may want to rethink this.
The Trip and Stay:
  • AirBnb: Saves a bunch. You could bring food in, cook some, get laundry done at the end of the day  - the advantages are tremendous and at a cost that's comparable to the decent bed-and-breakfast places.
  • Goldfish properties: Again, you get to rent and use a house(and all the above listed advantages that come with it).
Other tips:
  • Pack efficiently : This was an interesting learning for us as we moved from an Odyssey to an Outback (do not run out and buy an AWD if your only motivation is a few trips up to Lake Tahoe in winter. Read this first!). The space available was literally cut in half but we learnt and adapted.
  • A must-carry list:
    • Basic set of medicines (imagine the horror - 1 Tylenol tablet costs over a dollar at Heavenly), including Band Aid.
    • A multi-tool : We were in a situation where we needed to unscrew the face plate of a thermostat to replace the battery. While there were batteries readily available at the AirBnB place we rented, the screw head was almost of microscopic proportions and made it extra-hard. While on it, one of the first things to check once you land up : check if the heat and hot water works. You do not want to realize it when you're ready for bed.
    • Sunscreen, chap sticks
    • Chargers : A charger/battery pack is always helpful. There have been instances where the drive that usually takes about 3 hours has taken over 6 - Google maps is really handy but you need your phone charged to avail of this.
    • Flashlight
    • Nail clippers
    • Snow chains, gloves(you do not want to put on chains with your bare hands)
    • Your patience and sense of humor - remember, a family that skis together, stays together.
Happy skiing..

Thursday, January 19, 2017

Playing audio files with Echo using SSML and Python


Amazon offers the option of playing audio files via Echo using SSML. To quote:

" in some cases you may want additional control over how Alexa generates the speech from the text in your response. For example, you may want a longer pause within the speech, or you may want a string of digits read back as a standard telephone number. The Alexa Skills Kit provides this type of control with Speech Synthesis Markup Language (SSML) support."

I looked around for some examples to learn how this is achieved and ran into a brick wall. Here's what I learnt on (using python as my language) playing an audio file using Echo.

  • The <speak> tag: All SSML documents(text) need to be embedded within the speak tag.
  • The <audio> tag: Lets you provide the URL to an audio file.  There are some guidelines around the hosting and characteristics of the file you provide.
    • The MP3 must be hosted at an Internet-accessible HTTPS endpoint. (best bet? use S3)
    • No sensitive or customer specific information
    • Sample rate of 16000 Hz, bit rate of 48 kbps
    • No longer than 90 seconds

How do we address the requirements around characteristics? Thankfully, Amazon even identifies the tools and commands with which you can achieve this. 2 options(amongst the many available):

  • Command line: FFmpeg

    • following command converts the provided <input-file> to an MP3 file that works with the audio tag.

  • ffmpeg -i <input-file> -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 <output-file.mp3>
  • GUI: Audacity. (this needs the Lame library, available at: http://lame.buanzo.org/#lamewindl)
    • Open the file to convert.
    • Set the Project Rate in the lower-left corner to 16000.
    • Click File > Export Audio and change the Save as type to MP3 Files.
    • Set the Bit Rate Mode to Constant  and Quality to 48 kbps.
What are the code changes needed ? 
  • In the outputSpeech attribute:
    • set the type to SSML
    • use SSML for the marked up text(instead of 'text')
So, in effect, if you're used to seeing:

def build_speechlet_response(title, output, reprompt_text, should_end_session):
    return {
        'outputSpeech': {
            'type': 'PlainText',
            'text': output
        },
        'card': {
            'type': 'Simple',
            'title': title,
            'content':  output
        },
        'reprompt': {
            'outputSpeech': {
                'type': 'PlainText',
                'text': reprompt_text
            }
        },
        'shouldEndSession': should_end_session
    }

your function will now look something like:

def build_speechlet_response(title, output, reprompt_text, should_end_session):
    return {
        
        'outputSpeech': {
            'type': 'SSML',
            'ssml': output
        },
        'card': {
            'type': 'Simple',
            'title': title,
            'content':  output
        },
        'reprompt': {
            'outputSpeech': {
                'type': 'PlainText',
                'text': reprompt_text
            }
        },
        'shouldEndSession': should_end_session
    }

Here is an example of valid output(note, enclosed within the <speak> </speak>tags. Replace the bucket name and file name appropriately)

'<speak>This output speech uses SSML.<audio src="https://s3-us-west-2.amazonaws.com/<bucket name>/<file name.mp3>" />.</speak>'

When returned in outputSpeech, Echo will :
  • read out, in normal, Alexa's voice: "This output speech uses SSML."
  • and then play the audio file the URL points to.