Extract audio from a video
To extract the audio stream from a file, we export to WAV, since it's lossless and won't be re-encoded:
ffmpeg -i input-file.avi audio.wav
Of course, you could use a number of other codecs, such as FLAC or ALAC. WAV (or AIFF on Apple) would probably be best for editing though.
Now, apply any effects to your audio stream as necessary.
Recombine audio and video
To recombine an audio stream and a video file, run:
ffmpeg -i input-file.avi -vcodec copy -i audio.wav -acodec copy -map 0:0 -map 1:0
Remarks
It is important that the video and audio files are in the correct order (-i video, -i audio) for the stream mapping. Might not work otherwise. The -map 0:0 -map 1:0 option will map the audio from the file to the AVI instead of using the original audio. This is the most important parameter here.
You could theoretically change the -acodec copy to use any other compressed audio codec, because copy will try to use the uncompressed WAV codec. Similarly, you could of course just save the edited audio file to MP3 and use that instead, but keep copy.
If your audio file is shorter than the video file, you might want to loop it. Supply the -loop_input option to do this.