Trying to autodetect dtype for writeWave

closes #791