1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Raspberry PiでOrkAudioを動かす

Posted at

前書き

Oreka自体は主に通話録音をするOrkAudioと、通話録音したデータを収集するOrkTack、
通話録音したデータの管理をするOrkAudioの3つのソフトウェアで構成されています。

今回は通話録音をするOrkAudioをRaspberry Piで動作させます。
なお、今回の構成はミラーポートで取得したSIP/RTPパケットをOrkAudioで解析する構成です。
構成図はそのうち追記します。

環境

  • Raspberry Pi
    • 今回はRaspberry Pi 2で試しますが、3でも動作することを確認しています。
    • OS: Raspbian
  • USB NIC
    • ミラーポートから取得するため、イーサネットのインターフェースが2つ必要となります。

前提パッケージのインストール

# apt-get install -y automake libtool subversion \
 libspeex-dev liblog4cxx10-dev libace-dev libboost-dev \
 libpcap0.8-dev libxerces-c2-dev libsndfile1-dev

ソースコードの取得

% svn checkout https://svn.code.sf.net/p/oreka/svn/trunk oreka-svn

共通ライブラリのインストール(orkbasecxx)

% cd oreka-svn/orkbasecxx/
% libtoolize --force
% aclocal
% automake -a
% make -f Makefile.cvs
% ./configure LIBS="-ldl"
% make
# make install

OrkAudioのインストール

一部コンパイルが通らないため、パッチを当てます。

% cd oreka-svn/
% wget https://gist.githubusercontent.com/tatsuyaueda/c74af3fd6eb75fc9059e012e3012ed01/raw/3ea6337ce9f0aa976f91c1f06480a3c523ea847f/patch
% patch -p1 < patch
% cd orkaudio/
% libtoolize --force
% aclocal
% automake -a
% make -f Makefile.cvs
% ./configure LIBS="-ldl"
% make
# make install

設定

/etc/orkaudio/config.xml
        <!-- 録音した音声ファイルの保存先 -->
        <AudioOutputPath>/var/log/orkaudio/audio</AudioOutputPath>

        <!-- 録音した音声ファイルのフォーマット -->
        <!-- Audio file storage format: choose from: native, gsm, ulaw, alaw, pcmwav -->
        <StorageAudioFormat>pcmwav</StorageAudioFormat>
        <!-- 総受話分離のステレオ形式にする場合は下記の2行が必要 -->
        <StereoRecording>true</StereoRecording>
        <TapeNumChannels>2</TapeNumChannels>

        <!-- OrkTrackerのホスト名とポート番号 -->
        <TrackerHostname>192.168.50.3</TrackerHostname>
        <TrackerTcpPort>8022</TrackerTcpPort>

        <VoIpPlugin>
                <!-- キャプチャするネットワークデバイス -->
                <Devices>eth0</Devices>
        </VoIpPlugin>

起動スクリプト

Typeをforkingにして動かす方法が良く分からないから、とりあえず動くところまで。

/etc/systemd/system/orkaudio.service
[Unit]
Description=OrkAudio
After=network.target

[Service]
Type=simple
# PIDFile=/var/log/orkaudio/orkaudio.lock
WorkingDirectory=/var/log/orkaudio
ExecStart=/usr/sbin/orkaudio debug
# ExecStop=/bin/kill -WINCH ${MAINPID}
# TimeoutStopSec=5
StandardOutput=null

[Install]
WantedBy = multi-user.target

起動

# systemctl enable orkaudio
# systemctl start orkaudio
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?