If we have known that the audio track in the mp4 file is .mp3, we can use the following commands to extract the .mp3 without any transcoding:
a) using ffmpeg:
ffmpeg -i input.mp4 -acodec copy output.mp3
b) using gpac/mp4box
mp4box -raw 2 input.mp4
(here, -raw 2 means the audio is the 2nd track in mp4, this parameter may vary in different cases, you should try to change this number if it doesn't work)
If you do not mind the audio to be transcoded, you can just use:
ffmpeg -i input.mp4 output.[formart]
here, [format] can be .mp3, .aac, .mp2, etc, any audio format that ffmpeg supports.
for more information about ffmpeg and gpac, visit [1][2].
[1] ffmpeg org, www.ffmpeg.org/
[2] gpac org, http://gpac.wp.mines-telecom.fr/