Use int64 for TotalSamples.

It's 36 bits, so a 32bit integer won't do!
Add Decode().

Fixes #2