FW: simpleua application problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello

I need a little help with an application I am developing, it is a sip user agent, I have my own audio device implementation and I have used the auddemo application to verify that I can playback audio through my audio device

The next step was to use the simpleua sample, which works only with G711 codecs, however it is specified as 16 bits per sample, when it should be 8, at least that is what I've read everywhere else. The call is generated from an asterisk box, which I am positive is 8 bits per sample, so of course the audio is chopped up and distorted.

My audio device uses 16bit linear, so I thought I just had to receive the 8 bit samples and change the bit depth before delivering to the audio device, but apparently simpleua is expecting 16bit samples from the rtp data, is there a reason why this was implemented like this?

I looked in to the code, in pjmedia/src/pjmedia/g711.c

And it specifically sets the bit depth at 16 when the g711_default_attr function is called

static pj_status_t g711_default_attr (pjmedia_codec_factory *factory,
                                      const pjmedia_codec_info *id,
                                      pjmedia_codec_param *attr )
{
    PJ_UNUSED_ARG(factory);
    pj_bzero(attr, sizeof(pjmedia_codec_param));
    attr->info.clock_rate = 8000;
    attr->info.channel_cnt = 1;
    attr->info.avg_bps = G711_BPS;
    attr->info.max_bps = G711_BPS;
    attr->info.pcm_bits_per_sample = 16;     <---- is this what it is supposed to be??


......

It looks wrong to me because G711_BPS is defined as

#define G711_BPS            64000

And 16bits per sample x 8000 samples per second gives 128000

8 bits per sample x 8000 samples per second would give the correct value of 64000

And looking at other parts of the code, it seems the 16 bits per sample is hardcoded in other places as well. I might be misunderstanding the whole thing, and it is there for a reason. So if anyone could shed some light on the matter I would really appreciate it

Thank you

Jose
________________________________________
From: pjsip [pjsip-bounces@xxxxxxxxxxxxxxx] on behalf of pjsip-request at lists.pjsip.org [pjsip-request at lists.pjsip.org]
Sent: Thursday, March 28, 2013 5:02 PM
To: J Mena
Subject: Welcome to the "pjsip" mailing list

Welcome to the pjsip mailing list!


As a reminder, we also list answers to frequently asked questions at
http://trac.pjsip.org/repos/wiki/FAQ

Please take a look whether your question has been answered there.

To post to this list, send your email to:

  pjsip at lists.pjsip.org

General information about the mailing list is at:

  http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

If you ever want to unsubscribe or change your options (eg, switch to
or from digest mode, change your password, etc.), visit your
subscription page at:

  http://lists.pjsip.org/mailman/options/pjsip_lists.pjsip.org/jmena%40red-fone.com


You can also make such adjustments via email by sending a message to:

  pjsip-request at lists.pjsip.org

with the word `help' in the subject or body (don't include the
quotes), and you will get back a message with instructions.

You must know your password to change your options (including changing
the password, itself) or to unsubscribe.  It is:

  min1979

Normally, Mailman will remind you of your lists.pjsip.org mailing list
passwords once every month, although you can disable this if you
prefer.  This reminder will also include instructions on how to
unsubscribe or change your account options.  There is also a button on
your options page that will email your current password to you.



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux