core/frame: add proper function for audio frame truncation