Problems with Audio capture in IOS
aft
aftnix at gmail.com
Sun Apr 6 23:41:43 PDT 2014
On Sun, Apr 6, 2014 at 6:43 PM, Sebastian Dröge
<sebastian at centricular.com> wrote:
> On So, 2014-04-06 at 17:32 +0600, aft wrote:
>> Hi,
>>
>> I'm trying to capture voice from an IOS device and send it over
>> network using rtpbin. Now When i try to do the same between two
>> desktops (linux/Windows) it works fine. But in case of iOS device the
>> voice is distorted to the point that nothing can be recognized...
>>
>> The code i'm using to capture the voice is :
>>
>> pipeline = gst_pipeline_new (NULL);
>> g_assert(pipeline);
>>
>> audiosrc = gst_element_factory_make ("osxaudiosrc", NULL); //ios
>> audio source and mac audio src same?
>> g_assert (audiosrc);
>> audioconv = gst_element_factory_make ("audioconvert", NULL);
>> g_assert (audioconv);
>> audiores = gst_element_factory_make ("audioresample", NULL);
>> g_assert (audiores);
>> /* the encoding and payloading */
>> audioenc = gst_element_factory_make ("alawenc", NULL);
>> g_assert (audioenc);
>> audiopay = gst_element_factory_make ("rtppcmapay", NULL);
>> g_assert (audiopay);
>> /* add capture and payloading to the pipeline and link */
>> gst_bin_add_many (GST_BIN (pipeline), audiosrc, audioconv, audiores,
>> audioenc, audiopay, NULL);
>>
>> if (!gst_element_link_many (audiosrc, audioconv, audiores, audioenc,
>> audiopay, NULL)) {
>> g_error ("Failed to link audiosrc, audioconv, audioresample, "
>> "audio encoder and audio payloader");
>> }
>>
>> I'm feeling i'm doing something wrong when choosing the appropriate
>> element used as "src".
>
> Does it work better if you force a different sample rate after the
> source with a capsfilter (e.g. try 16000, 32000, 44100 and 48000)?
>
Well no luck with different sample rates. The caps i'm using :
GstCaps *rescaps;
rescaps = gst_caps_new_simple("audio/x-raw", "format",
G_TYPE_STRING, "S32LE",//also tried "S16LE"
"rate", G_TYPE_INT, 48000, //also
tried 44100, 32000, 16000
"channels", G_TYPE_INT, 2, //also tried 1
NULL);
gst_element_link_filtered (audiosrc, audioenc, rescaps);
gst_element_link (audioenc, audiopay);
> --
> Sebastian Dröge, Centricular Ltd - http://www.centricular.com
> Expertise, Straight from the Source
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
--
-Cheers
-Arif
More information about the gstreamer-devel
mailing list