WIP: audio prep work for gapless

Still have some loose ends, but opening PR so people can start looking at this.
What do you mean with "the end"? Is this a typo?