[Asterisk-Dev] Handling AST_FORMAT_SLINEAR at 48000Hz
voipwala hindustani
voipwala at gmail.com
Wed Nov 16 22:50:49 MST 2005
Hi Asterisk hackers,
I have this situation. I have a music player application X, with is writing
to my /dev/dsp. I wanted to send this music from /dev/dsp to a caller who
dials to asterisk.
So to get the voice data from /dev/dsp. I have written my own device hacking
functions and loaded with LD_PRELOAD before starting application X. Now I
could get the data which was written to /dev/dsp. The native format of this
data is AFMT_S16_LE (Signed 16 bit Little Endian) at 48000 Hz sampling
speed.
In order for asterisk to communicate with this, I have created a new channel
called MYCHAN and when ever an asterisk user is calling to a particular
extension, i am reaquesting a Dial to my new channel. This also happens
fine. In my scenario the external caller is a SIP caller with his native
codec as ulaw.
But my problem is, I have chosen AST_FORMAT_SLINEAR as my native format for
my new channel MYCHAN. This takes care of AFMT_S16_LE to ulaw conversion and
vice versa automatically since asterisk core checks for the native types of
channels before bridging them. But inside asterisk AST_FORMAT_SLINEAR is
assumed to be of 8000Hz sampled voice. But in my case it is 48000Hz sampled.
Is there any native format for my channel with will take care of this. some
format like signed 16 bit little endian but at 48000 Hz ?
or
Will i be able to take care of this during conversion to ulaw, by hacking
some code ?
or
is there any other way to send my AFMT_S16_LE at 48KHz over ulaw from
asterisk ?
Thanks for you help in advance.
Regards,
voipwala
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20051116/9c0753ab/attachment.htm
More information about the asterisk-dev
mailing list