audio from microphone to aac file is not working

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

audio from microphone to aac file is not working

pumba
I've tried to create an .aac audio file using gstreamer. Here's my code for it:
gst-launch-1.0 autoaudiosrc ! audioconvert ! voaacenc ! filesink location=file.aac

It does creates a file with that name, but that file is not playable.

when I replace the voaacenc element with lamemp3enc to create an mp3 file, it works.

now, what should I do to create an .aac file from microphone input ?
Reply | Threaded
Open this post in threaded view
|

Re: audio from microphone to aac file is not working

Vivia Nikolaidou
Hi,

Raw AAC data cannot be played. You need to either mux it into a
container or convert to ADTS:

gst-launch-1.0 autoaudiosrc ! audioconvert ! voaacenc !
"audio/mpeg,stream-format=adts" ! filesink location=file.aac

In more complicated pipelines, you might want to add an aacparse
element after voaacenc.

On 31 August 2016 at 13:46, pumba <[hidden email]> wrote:

> I've tried to create an .aac audio file using gstreamer. Here's my code for
> it:
> gst-launch-1.0 autoaudiosrc ! audioconvert ! voaacenc ! filesink
> location=file.aac
>
> It does creates a file with that name, but that file is not playable.
>
> when I replace the voaacenc element with lamemp3enc to create an mp3 file,
> it works.
>
> now, what should I do to create an .aac file from microphone input ?
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/audio-from-microphone-to-aac-file-is-not-working-tp4679315.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: audio from microphone to aac file is not working

pumba
have you tried running this code in terminal ? I'm getting no sound while playing in vlc.
Reply | Threaded
Open this post in threaded view
|

Re: audio from microphone to aac file is not working

pumba
I've solved the problem to an extend, here's the pipeline:

gst-launch-1.0 alsasrc ! "audio/x-raw,channels=2,rate=48000,format=S16LE" ! audioconvert ! "audio/x-raw,channels=2,rate=48000,format=S16LE" ! voaacenc ! "audio/mpeg,stream-format=adts,channels=2,rate=48000"  ! filesink location=goo.aac

still some random noise is there.