Append part of the audio at the end of another audio With audio files A and B:

A : |--- Some content ---|--- Extra content --- |

B : |--- Some content ---|

Assume the end of B is where the start of the extra content in A.

I want to append that extra content at the end of B.

Can I achieve this with some command line programs, such as ffmpeg?
Assuming the duration of B is X (in seconds), you would use

ffmpeg -i A -i B -filter_complex "[0]volume=0:enable='lt(t,X)'[a];[a][1]amix=duration=first:dropout_transition=0,volume=2" out