Don't confuse encoding with containers. You cannot have an AAC encoded WAV, WAV's are PCM. You can have a 4k WAV or you can have an AAC encoded file in an MP4 or M4A container. Both examples are below. Note that in these examples the AAC encoders get very picky if you try to change the sample rate below 48000.
Create raw audio file
gst-launch audiotestsrc num-buffers=100 \
! audio/x-raw-int, rate=48000, channels=2, endianness=1234, width=16, depth=16, signed=true \
! filesink location=foo.pcm
Encode it as a WAV
gst-launch filesrc location=foo.pcm \
! audio/x-raw-int, rate=48000, channels=2, endianness=1234, width=16, depth=16, signed=true \
! audioresample \
! audio/x-raw-int, rate=4000 \
! wavenc \
! filesink location=foo.wav
Encode it as AAC and mux into mp4
dont really know why I had to encode then decode again, but nothing else worked, even though I could go directly from the audiotest src.
gst-launch filesrc location=foo.pcm \
! audio/x-raw-int, rate=48000, channels=2, endianness=1234, width=16, depth=16, signed=true \
! wavenc \
! wavparse \
! ffenc_aac \
! mp4mux \
! filesink location=foo.mp4
..alternately using faac
the pipeline was a lot cleaner and the output file was smaller
gst-launch filesrc location=foo.pcm \
! audio/x-raw-int, rate=48000, channels=2, endianness=1234, width=16, depth=16, signed=true \
! faac \
! mp4mux \
! filesink location=foo.mp4
or voaacenc
voaacenc wouldn't work below 48000 even though it looks to have the most flexible capabilities. I tried 8k,16k,48k,96k and 44100 which anecdotally changed the pitch of the test tone.
gst-launch filesrc location=foo.pcm \
! audio/x-raw-int, rate=48000, channels=2, endianness=1234, width=16, depth=16, signed=true \
! voaacenc \
! mp4mux \
! filesink location=foo.mp4
Low bit rate AAC
The lowest AAC bitrates I was successful with was 16000, here are those tests, again noting that faac produced the smallest file size.
gst-launch audiotestsrc num-buffers=100 \
! audio/x-raw-int, rate=16000, channels=2, endianness=1234, width=16, depth=16, signed=true \
! ffenc_aac \
! mp4mux \
! filesink location=foo.mp4
gst-launch audiotestsrc num-buffers=100 \
! audio/x-raw-int, rate=16000, channels=2, endianness=1234, width=16, depth=16, signed=true \
! faac \
! mp4mux \
! filesink location=foo.mp4