The rate of Recording and Playing

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

 



Hi,

I upload two wav files to explain my problem.
The file recorded by this
way(http://trac.pjsip.org/repos/wiki/audio-how-to-record) could be
found here http://moon.cse.yzu.edu.tw/~s912356/output_people_8000.wav.
It sound slow and low pitch. The correct one should sound like this
http://moon.cse.yzu.edu.tw/~s912356/output_people_16000.wav.

I made following testings to clarify my problem.
1. "cat /dev/dsp > file", and then "cat file > /dev/dsp" => Correct
2. Record and Play audio by portaudio(testing src is
third_party/portaudio/test/patest_record.c) => Correct
3. PJSUA Looping-back
testing(http://trac.pjsip.org/repos/wiki/audio-check-loopback) =>
Correct
4. Record any audio either from file or mic by PJSUA, and Play them on
Davinci by PJSUA and sample/playfile => Correct
5. Record any audio either from file or mic by PJSUA, and Play them on
my PC by mplayer => Slow and low pitch. It would be correct if playing
it with double rate, saying 16000Hz.
6. VoIP between PJSUA on Davinci and PJSUA on Linux. => Slow and low pitch.

So I infer the problem is triggered by pjsip. How can I dig out them in pjsip?



FCWu



2008/10/10 Nanang Izzuddin <nanang at pjsip.org>:
> Hi,
>
> Not sure what's going on, but I agree it seems to be a sound device
> issue, e.g: it may be actually opened in either stereo or 16KHz. I
> found this old post that may be related to this issue:
> http://mlblog.osdir.com/linux.davinci/2006-10/msg00283.shtml, as it
> says "Davinci OSS driver don't work correctly in mono mode and driver
> still return two samples per tick". Perhaps you can check this by
> running pjsua in stereo mode (with param '--stereo') and see the mic
> recording result. Then you can also check pjsua with clock rate 16KHz.
>
> In case it *is* sound device issue, you can also search/post a
> question in the PortAudio forum (PJSIP uses PortAudio on linux
> platform). Moreover, you can implement your own sound device wrapper,
> please see http://trac.pjsip.org/repos/wiki/External_Sound_Device for
> the build config.
>
> Regards,
> nanang
>
>
> On Thu, Oct 9, 2008 at 1:25 PM, Fan-Cheng Wu ?????\ <fcwu.cs95g at nctu.edu.tw> wrote:
>> Hi All,
>>
>> I experienced pjsua on TI Davinci, which configured ./aconfigure
>> --host=armv5tl-montavista-linuxeabi CFLAGS='-O2 -msoft-float -DNDEBUG
>> -mcpu=arm926ej-s' --disable-floating-point and defined "#define
>> PJSUA_DEFAULT_CLOCK_RATE   (8000)" on config_site.h.
>> When I run pjsua to record sound of 10 second from mic to a file, the
>> file would be extended to 20 second long and sound lower pitch than
>> original one. (Play it with double rate, it sound fine.) I suppose
>> it's because recording device has wrong recording rate. Anybody knows
>> how can I adjust it?
>>
>> p.s. If I recorded a default ring sound from port 02 (Port #02[
>> 8KHz/20ms/1] ring transmitting to: ), it's also correct. So the
>> problem come from recording device (?).
>>
>> The following are the steps I recorded sound from mic.
>> ./pjsua-armv5tl-montavista-linux-gnueabi --rec-file=output.wav
>> --clock-rate=8000 --snd-clock-rate=8000
>> ...
>>>>> cc 0 1
>>  07:49:01.566  pjsua_media.c  pjsua_set_snd_dev(): attempting to open
>> devices @8000 Hz
>>  07:49:01.758     ec0x150df8  AEC created, clock_rate=8000, channel=1,
>> samples per frame=160, tail length=200 ms, latency=96 ms
>>  07:49:01.759   conference.c  Port 3 (ring) transmitting to port 1 (output.wav)
>>
>>
>>
>> Best Regards,
>> FCWu
>>
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>>
>> pjsip mailing list
>> pjsip at lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>


[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