Fix audio demultiplexing

Also refactoring.