반응형

한참도 전에 asterisk 기반 오픈소스를 이용해서 IPPBX를 개발하고 운용했다.

오랜만에 부탁받은 음성파일 오류가 있어서  확인했더니 볼륨도 작고 파일자체도 크게 샘플링되어 있었다.

고쳐주기위해서 간만에 프로그램을 다시 깔았다.

요즘엔 어도비 오디션(Adobe Audition)을 사용하는데 쿨에디터만큼 쉽고 간단한 프로그램이 없다.

 

 

ASTERISK기반의 IPPBX는 대부분 WAV파일 , MP3, GSM 방식의 파일포멧을 사용중인데.

보통 샘플링은 8000HZ 16bit 권장이다. 어차피 전화 넘어로 들리는 소리라 MONO면 충분하다.

프로그램이 준비되어있다면 ..( 혹시 없다면 보내드릴수도....)

1.음성을 변환할 파일을 선택한 다음 알맞게 편집한뒤에 메뉴에서 EDIT->Convert Sample Type을 선택한다.

 

2.아래 이미지와 같이 샘플링을 변환한다.

 

3.파일저장은 Windows PCM.wav로 저장한다.

 

끝!~ 그리고 사용하면 된다.

 

 

 

 

반응형

'VOIP > ASTERISK' 카테고리의 다른 글

ILBC codec 설치- asterisk  (0) 2012.07.11
녹취딜레이현상 audiohook 수정  (0) 2012.04.18
반응형

ILBC codec 설치

 

 

<혹시몰라서 파일첨부~>

 

 

 

출처 http://wiki.kolmisoft.com/index.php/ILBC_codec

 

Jump to: navigation, search

The iLBC source has been removed from Asterisk due to licensing concerns

Can be installed back again using instructions from page: http://www.voip-info.org/wiki/view/iLBC

Simple instructions if above guide does not work:

Go to your asterisk directory:

cd /usr/src/ASTERISKDIRECTORY

 

Afterwards

cd /contrib/scripts

 

wget -P codecs/ilbc http://www.ietf.org/rfc/rfc3951.txt

 

wget -q -O - http://www.ilbcfreeware.org/documentation/extract-cfile.txt | tr -d '\r' > codecs/ilbc/extract-cfile.awk

 

cd codecs/ilbc && awk -f extract-cfile.awk rfc3951.txt

 

Copy all contents from

/usr/src/ASTERISKDIRECTORY/contrib/scripts/codecs/ilbc/ to /usr/src/ASTERISKDIRECTORY/codecs/ilbc/ directory

 

Recompile Asterisk for ilbc codec support:

cd /usr/src/ASTERISKDIRECTORY

 

./configure

 

make

 

Select ilbc codec for installation

make menuselect

 

make install

 

To check if codec is installed, connect to Asterisk CLI and issue command:

core show translations

 

You should get a similar output:

server*CLI> core show translation

Translation times between formats (in milliseconds) for one second of data

Source Format (Rows) Destination Format (Columns)

 

g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722

g723 - 2 2 2 2 2 1 3 6 - 14 2 2

gsm 8 - 2 2 2 2 1 3 6 - 14 2 2

ulaw 8 2 - 1 2 2 1 3 6 - 14 2 2

alaw 8 2 1 - 2 2 1 3 6 - 14 2 2

g726aal2 8 2 2 2 - 2 1 3 6 - 14 2 2

adpcm 8 2 2 2 2 - 1 3 6 - 14 2 2

slin 7 1 1 1 1 1 - 2 5 - 13 1 1

lpc10 8 2 2 2 2 2 1 - 6 - 14 2 2

g729 8 2 2 2 2 2 1 3 - - 14 2 2

speex - - - - - - - - - - - - -

ilbc 9 3 3 3 3 3 2 4 7 - - 3 3

g726 8 2 2 2 2 2 1 3 6 - 14 - 2

g722 8 2 2 2 2 2 1 3 6 - 14 2 -

 

---------------------------------------------------------------

extract-cfile.txt

 

rfc3951.txt

 

반응형
반응형

Index: include/asterisk/audiohook.h
===================================================================
--- include/asterisk/audiohook.h (revision 147197)
+++ include/asterisk/audiohook.h (working copy)
@@ -56,6 +56,8 @@
  AST_AUDIOHOOK_TRIGGER_SYNC = (1 << 2),  /*!< Audiohook wants to be triggered when both sides have combined audio available */
 };
 
+#define AST_AUDIOHOOK_SYNC_TOLERANCE 100 /*< Tolerance in milliseconds for audiohooks synchronization */
+
 struct ast_audiohook;
 
 /*! \brief Callback function for manipulate audiohook type
Index: main/audiohook.c
===================================================================
--- main/audiohook.c (revision 147197)
+++ main/audiohook.c (working copy)
@@ -130,12 +130,19 @@
  struct ast_slinfactory *factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_factory : &audiohook->write_factory);
  struct ast_slinfactory *other_factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->write_factory : &audiohook->read_factory);
  struct timeval *time = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_time : &audiohook->write_time), previous_time = *time;
+ int our_factory_ms;
+ int other_factory_samples;
+ int other_factory_ms;
 
  /* Update last feeding time to be current */
  *time = ast_tvnow();
 
+ our_factory_ms = ast_tvdiff_ms(*time, previous_time) + (ast_slinfactory_available(factory) / 8);
+ other_factory_samples = ast_slinfactory_available(other_factory);
+ other_factory_ms = other_factory_samples / 8;
+
  /* If we are using a sync trigger and this factory suddenly got audio fed in after a lapse, then flush both factories to ensure they remain in sync */
- if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && ast_slinfactory_available(other_factory) && (ast_tvdiff_ms(*time, previous_time) > (ast_slinfactory_available(other_factory) / 8))) {
+ if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && other_factory_samples && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) {
   if (option_debug)
    ast_log(LOG_DEBUG, "Flushing audiohook %p so it remains in sync\n", audiohook);
   ast_slinfactory_flush(factory);

 

반응형

+ Recent posts