Fixed bug in audio writer