LibAO should support format change without closing/opening devices.
To achive gapless playback between two files with diffrent samplerate you should really have the option to change the audio format without closing and opening the device. This is supported by most audio backends and should be a new api call to libao.