work on code to decode in samples buffer