Fix sound stream writing