[Freeswitch-dev] Questions on implementing mod_nelly codec
ritzalam at gmail.com
Mon Mar 21 21:58:22 MSK 2011
We've been trying to implement a mod_nelly codec but so far has been
unsuccessful. We use a Nellymoser compatible codec submitted to ffmpeg
(see June 16, 2008 entry of http://ffmpeg.org/).
Our plan is to use Flash using Nellymoser to connect to a conference
The hurdle seems to be that Nellymoser decodes 64 byte nelly audio to
512 byte L16. Nellymoser is 11-Khz 8-bit per sample with 32 ptime.
However, L16 implementations are all 20 ptime
which have uncompressed bytes in multiples of 320. This doesn't align
with what mod_nelly expects when encoding (convert 512 bytes to 64
bytes) and decoding (64 bytes to 512 bytes).
Here is the SWITCH_MODULE_LOAD_FUNCTION(mod_nelly_load)
[http://pastebin.freeswitch.org/15764] now. We've played around with
the samples per second (SPS), actual samples per second (ASPS),
bits per second (BPS), and the ptime (PTIME) but with no luck. It's
either we get bad very choppy audio, incompatible destination (when
codecs can't match), or no audio at all. We've managed to get the
"You will now be placed into the conference" audio played correctly
but the audio from the caller is bad. Just the paying of wav file from
FS is correct.
My question is how does transcoding works in FS? Am I correct to
assume decoding as Nelly->L16 and encoding as L16->Nelly?
So basically the media flow for our use case is Nelly -> L16 -->
mod_conference -> L16 -> Nelly.
Do I need to make the frames align? In this case, Nelly expect 256
samples per frame while L16 has 160, 320, ... samples per frame.
Hope I've articulated clearly what we are trying to accomplish.
Suggestions and ideas on what to try out next is much appreciated.
Thanks in advance.
More information about the FreeSWITCH-dev