Fix for #38 (closed) & #39 (closed).
-
Add a type safe at(index) function that returns the sample at the given index, with the proper type.
-
Remove the operator[] as it was only used internally and referenced bytes instead of samples.
Note this does not remove byte level access to the buffer, that can be done via cbegin(). This change is designed to keep a consistent view of the buffer as a collection of samples.
- Added a constructor overload that takes a std::vector, so that data can be moved into the buffer instead of copied.