Masayuki Takigahira

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 68 total)
  • Author
    Posts
  • in reply to: harktool5-guiについて #2596

    お問合せありがとうございます。

    > tsp信号は同期録音ではないため各音源ごとに多少のずれがあります。
    問題ございません。HARKTOOL5の下記のURLにある機能を使用して頂き、音が含まれる区間(start ~ end)を指定して頂くと伝達関数を作成できます。「Use TSP record Files」となっているところを「Use Mouth TSP Record Files」に変更すると設定用の項目が表示されます。
    複素回帰モデルを用いた伝達関数推定

    > tsp信号はharkダウンロード時に得られるものを
    「ダウンロード時に得られるもの」というのは下記のファイルという事で合っていますでしょうか。
    /usr/share/hark/16386.little_endian.tsp または
    /usr/share/hark/16386.little_endian.wav

    > 再生環境に合わせ変換したものを使用しておりrate:48000,float32bitのものを使用しました。
    再生については制限がありませんが、収録するTSPは 16bit integer または 24bit integer の WAV ファイルで収録をお願いします。

    また、「再生環境に合わせ変換」とありますが、具体的にはどのように行われたのでしょうか。
    アップサンプリングを行っても16kHzの入力(ナイキスト周波数の8kHzまでの音)までしか分離する事が出来ません。また、再生するTSPがアップサンプリングにより歪みますので音声などが目的の場合で16kHzでも十分な場合にはTSP信号自体をアップサンプリングするのではなく、16kHzのままで再生して頂いた方がベターです。再生デバイスは通常、複数のサンプリングレートに対応していますので16kHzのままでもファイルを再生できるはずです。

    音声の定位や分離が目的である場合は16kHzで十分に機能しますので、次のケース1または、ケース2のどちらかの方法で対応してください。
    音楽や電子音など高周波数帯域の定位や分離も行いたい場合は、ケース3の方法で48kHz用のTSP信号で対応してください。その場合、音声認識に関しては通常16kHz(あるいは8kHz)用にモデルが作られているため、そのままでは音声認識が出来ない事に注意して下さい。
    *) 我々が提供しているKaldiのモデルは16kHz用です。

    ケース1:16kHzで収録し、16kHzで処理する。
    音声のみを対象としている場合は、こちらの手順を推奨します。
    TSP収録時のマイク設定を16kHzにした状態(*)で収録して頂き、HARKで処理を行う際も16kHzで使用する。
    伝達関数は16kHzで作成したものを使用します。
    *) マイクデバイスが対応していれば、サンプリングレートを変更して収録が可能です。
    arecord などでは -r オプションで収録するサンプリングレートが指定できます。

    ケース2:マイクの設定は48kHzのままで、収録時とHARK処理時にDownSamplingし、16kHzで処理する。
    マイクが16kHzでの収録に対応していない場合はこちらの手順で16kHz対応のマイクと同様に処理できます。
    HARKで「AudioStreamFromMicノード」の後に「MultiDownSamplerノード」を接続して48kHzを16kHzにダウンサンプリングする事が出来ます。TSP収録を「AudioStreamFromMic、MultiDownSampler、SaveWavePCM」という接続のネットワークで行って頂き、HARKで定位/分離処理を行うネットワークでも同様に「MultiDownSamplerノード」を挿入して頂く事で16kHzとして処理できます。
    伝達関数は16kHzで作成したものを使用します。

    ケース3:
    音楽や電子音のように高い周波数を含む48kHzの入力(ナイキスト周波数の24kHzまでの音)を分離したいという要望であれば、下記のURLにあるように48kHz用のTSP信号を使用する必要があります。
    Recording TSP
    HARKTOOLで不具合が発生する場合は、GUIを使用せずコマンドラインから作成しなければならない場合があります。エラーなどが発生しましたら再度ご連絡ください。

    > 伝達関数を生成するサンプルのtsp録音データなどがあれば頂けると幸いです。
    サイズが大きいため公式サイトからのダウンロード提供は今まで行っておりませんでしたが、公開しているTAMAGO03の伝達関数を作成する際に使用したTSP収録データはございます。
    ただし、こちらは16kHzで収録したデータになります。16kHz以外の例えば48kHzでのサンプルとなりますとご提供可能な(公開可能な)収録データがございません。
    TAMAGO03用(16kHz)で宜しければ下記からダウンロード出来ように致しました。
    TAMAGO03 TSP recording data
    サイズを小さくするため 7-zip 形式で圧縮しておりますので、下記のように 7-zip を入れて頂いてから展開して頂けますでしょうか。

    
    sudo apt install p7zip-full
    7z x tsp.7z
    

    以上、宜しくお願い致します。
    HARK support team.

    in reply to: Separation for 3D Audio #2577

    Thank you for your inquiry.

    Q.1
    But I don’t know how to record the TSP response, mainly because I don’t know how to run wios and I don’t know how to make the loudspeaker output the TSP even after reading and watching the tutorials you have.

    A.1
    From HARKTOOL5, we have provided a method to create a transfer function from recorded data whose playback and recording are not synchronized. In other words, instead of wios, you can record TSP with a combination of common playback tools (such as aplay) and recording tools (such as arecord).

    Please refer to the following URL for the information necessary for setting to use the transfer function creation algorithm newly provided in HARKTOOL5.

    https://www.hark.jp/document/packages/harktool5-gui-en/harktool5-gui.html#fd-conv-label

    Below is an example command to play a TSP for 60 seconds with the default playback device.

    
    sox /usr/share/hark/16384.little_endian.wav tsp_60sec.wav repeat 59
    play tsp_60sec.wav &
    

    You can prepare the recording data by the following steps.

    1. Keep playing the TSP repeatedly in the direction of the sound source you want to record.
    Notes:
    It’s best if you have a monitoring speaker with a constant frequency response, but if you pay attention to the following points, you can use a normal speaker.
    ・In general, if the volume is lowered or raised too much, distortion will occur depending on the characteristics of the amplifier. It is better not to go below 20% or above 80%.
    ・It is better to use PC speakers with a certain diameter instead of small speakers built into smartphones. You can also take the approach of connecting a good quality speaker to your smartphone.
    ・For PCs, software effects (theater mode, etc.) attached to the Audio chipset may be enabled, and for smartphones, the vendor’s own virtual high quality technology may be enabled, so please turn it off.

    2. Record the TSP of “1.” in multi-channel with your microphone array. Any recording software can be used, but it is recommended to select a sampling frequency of 16 kHz in order to use HARK with the default settings.
    Notes:
    Respeaker has a function to output 1ch data after beamforming, but please record all channels of raw PCM without using the beamforming function. It’s a good idea to record at least 20 seconds per direction.

    3. Repeat “1.” to “2.” for multiple sound source directions. Be sure to record the direction of the separation target.
    Notes:
    Please adjust the speaker volume and microphone sensitivity to avoid clipping. Do not change the speaker volume and microphone sensitivity once determined, and use the same settings in all directions. Be especially careful if you have speakers close to the microphone array.

    Regarding the distance between the speaker (sound source) and the microphone array:
    Place the loudspeaker at the sound source position of interest to be localized or isolated. For voice, the speaker should be positioned close to the mouth of the person speaking. The conversational robot will be about 1m, but if you are sitting on a seat and talking to a PC, it will be about 30cm. No minimum distance is specified, but be careful not to clip.

    4. After recording is completed in all directions, select a section containing sound and select at least 10 seconds or more (eg 16 seconds) to cut out. You can use any software to cut out, but please be careful not to convert the output format. With software such as sox, if you specify only the start time and length with the trim command, the format is preserved.
    Notes:
    For ease of setting in HARKTOOL5, it would be better if the PCM data for each direction has the same length. Also, since the space reflection sound is not included immediately after the start of the section containing the sound, it is better to start cutting out about 1 second after the start of the section containing the sound, not immediately after the start. . However, if the reverberation continues for a few seconds in a hall, etc., shift the extraction start point according to the reverberation time so that the section that fully includes the reflected sound is extracted.

    Q.2
    And I would like to know if there is a minimum distance between the loudspeaker and the microphone array when the response is being recorded?

    A.2
    As shown in the steps above, there is no minimum distance if you are careful with clipping. However, if the microphone array is placed directly on a table, it can be adversely affected by table reflections. It can also pick up table vibrations. If it is judged that there is an adverse effect, consider floating the microphone array with a tripod or the like.

    Q.3
    The location where the recording is made is complex with obstacles, what is the minimum number of TSP recordings that you recommend around the microphone array?

    A.3
    If the sound source position is fixed, the only mandatory source direction is the direction where the source to be separated is located. The sound source positions do not have to be evenly spaced. The sound source is not limited to the object such as voice, but also includes noise from a specific direction if you want to remove it by separating it. Also, it is necessary to record in a positional relationship where the sound reaches the microphone array directly. When recording TSP, be careful not to place any obstacles between the speaker and the microphone array that would block the direct sound arrival.

    As is concerned, in environments where the transfer function varies significantly with azimuth change (e.g., environments with many obstacles or rooms with complex shapes), the transfer function may not match when deviating from the known source direction, degrading the separation performance. There is no problem with simulations that synthesize inputs, but when performing live demonstrations, it is recommended to also create a transfer function for a position that is 5 to 10 degrees off the original position of the sound source. By creating such a transfer function, even if the speaker’s position deviates a little, the SourceTracker node can track the movement of the nearby sound source.
    The transfer function we provide is created with 72 directions in 5 degree units for 360 degree omnidirectional moving sound source tracking assuming that the speaker walks around the robot. On the other hand, in an environment where you know there are speakers at 15 and 45 degrees, it’s fine to restrict the orientation of the transfer function to just the directions in which the speakers are. For example, 10, 15, 20, 40, 45, and 50 degrees may be enough, assuming that the position of the speaker is slightly off. Even with such a direction-limited transfer function, it is possible to separate speaker A at 10 to 20 degrees and speaker B at 40 to 50 degrees. Of course, if you take the solution of telling the speaker A and B to stay at a point marked as the sound source location when doing the demo, then we don’t need additional TSP recordings in the vicinity of the assumed sound source.

    If you have any questions, please feel free to contact us.
    Thank you.

    Best regards,
    HARK support team

    in reply to: iGEVD-MUSIC法について #2556

    お問い合わせありがとうございます。

    iGEVDは雑音相関行列を逐次的に変化させるという認識で合っています。追加パッケージは不要です。
    直前(指定したフレーム前)の相関行列を雑音相関行列とみなすことで実現します。

    仰る通り、作成済み雑音相関行列を CMLoad ノードで読み込む代わりに CMMakerFromFFT または CMMakerFromFFTwithFlag ノードで相関行列を生成しながら LocalizeMUSIC ノードの NOISECM 端子に与えるネットワークにします。
    ここで注意点として、INPUT 端子へ入力する信号と NOISECM 端子へ入力する雑音相関行列を同じフレームから生成してしまうと自分自身を WhiteNoise 化してしまうため MUSIC スペクトルでピークが出なくなってしまいます。そのため、 Delay ノードを挿入して入力フレームをずらす必要があります。
    HARKの仕様として、 Delay ノードに与える遅延量は負値で与える必要がありますのでご注意ください。正値で入力した場合、後段ノードに対して入力が揃っていない状態で計算指示を出している意味になりクラッシュします。負値の場合は、後段ノードに先行フレームなのでバッファに保持しておいてくださいという指示になり、後段ノードの計算開始タイミングをずらすという処理となります。

    iGEVD-MUSIC の場合は LocalizeMUSIC のパラメータを GEVD に、iGSVD-MUSIC の場合は LocalizeMUSIC のパラメータを GSVD に設定して下さい。

    iGEVD/iGSVD いずれの場合も継続音がある場合は雑音として扱われてしまうため、人間の声で「あーーーー」と言い続けていたり電子音で「ピーーーー」と鳴り続けている場合には音の出始め部分だけピークが出て、あるフレーム以降はピークが消えます。
    検出したい継続音がある場合は、 Delay ノードの遅延フレーム数と CMMakerFromFFT ノードや LocalizeMUSIC ノードのウィンドウサイズを調整して頂くと解決できる場合があります。

    ご不明な点がございましたら、コメントでご返信ください。

    以上、宜しくお願い致します。
    HARK Support Team.

    in reply to: Kaldi results / training a new model #2365

    Yes, the correct way is to adjust the MultiGain connected after AudioStreamFromMic. To check the amplitude of the separated sound, check the output of SaveWave PCM. The HARK Cookbook URL below is an example of a SaveWave PCM connection. The IJCAI-PRICAI network file differs in that the separated sound after noise suppression is output, but the connection is such that the separated sound is output as in “Connection example 2”.
    https://www.hark.jp/document/hark-cookbook-en/subsec-Separation-002.html

    Note: The IJCAI-PRICAI network file uses the separated sound file output by SaveWave PCM only for confirmation. When converting to features, the frequency domain is calculated as it is, so be aware that changing the gain parameter of Synthesize does not affect the features used in the recognition process.

    Use a toolkit called Kaldi to train the model. Kaldi contains a number of sample recipes for learning models with the corpus.
    https://www.kaldi-asr.org/
    https://github.com/kaldi-asr/kaldi
    We use a paid corpus, but there are also free corpus. Fortunately, there are many free English corpus.

    Note that we are using MSLS features. It is not a general MFCC features. Therefore, we will propose two methods, so please select the one you want.
    We have confirmed that using MSLS features is better than MFCC features, so we chose method 2, but the work cost is less if we choose 1.

    1. Simply replace the MSLS Extraction contained in the HARK network file with the MFCC Extraction and match the feature dimensions to those used by the recipe.
    2. Understand the features output by MSLS Extraction and make some patches to the recipes used for learning Kaldi.

    Work required to prepare training data:
    First, the impulse data is convoluted into the corpus data to be used, and the input data that simulates the microphone array coming from various sound source directions is prepared.

    For method 1:
    Next, input the data that simulates the input of the prepared microphone array to the network file, and use the separated sound file output by SaveWave PCM for learning.

    For method 2:
    Next, prepare a network file to obtain the features to be learned. Duplicate the network file you are currently using for speech recognition and make the following modifications: Use AudioStreamFromWAV instead of AudioStreamFromMic. At that time, don’t forget to set CONDITION for the EOF terminal. HARK also has a Save HTK Feature node for saving in HTK Feature format. The feature amount input to SpeechRecognition (SMN) Client is connected to SaveHTKFeature. At that time, set the parameter of SaveHTKFeature to USER.
    In the created network file, data that simulates the input of the microphone array prepared first is input, and the output feature amount file is used for training.
    Replace the features learned by Kaldi with those output by HARK. Also, match the number of dimensions in the config file related to the features of the learning recipe.
    Supplementary explanation: Kaldi has a method of learning while converting PCM data to features, but please do not use Kaldi’s feature conversion function and directly read the HTK Feature format output by HARK for learning. By doing so, the patch that outputs the MSLS feature to Kaldi’s feature conversion program becomes unnecessary.

    Best regards,
    HARK support team.

    in reply to: Kaldi results / training a new model #2351

    Thank you for your inquiry.

    The model we are distributing is a learning of the separated sound of the TAMAGO-03 microphone array. When used with different microphone arrays, at least the difference in the volume of the separated sound input when generating the feature amount causes a decrease in recognition performance. Please try to compare the volume of the separated sound with the original evaluation set of IJCAI-PRICAI and adjust the volume until the performance improves.

    Also, if the microphone arrangement is significantly different from the TAMAGO-03 microphone array, the recognition performance may deteriorate because the tendency of distortion after separation is different. For best results, you need to create your own model by learn the separated sounds in your microphone array.

    Since it is a language model learned with a large vocabulary, many words can be recognized unless it is a word such as jargon or slang, so a language model with a small vocabulary should not be necessary. If you really need to create your own language model, please use Kaldi’s tools to create your language model. You need to run mkgraph.sh with arguments to the directory containing the “final.mdl” file and the directory of your language model.

    Best regards,
    HARK support team.

    in reply to: Use kaldi trained model in mobvoihotwords #2295

    Thank you for your inquiry.

    
    [ERROR] Expected token "<Nnet3>", got instead "<DIMENSION>".
    

    According to the content of the error message, it seems that a file that is not a model in nnet3 format was entered. First, please check the your recipe used for learning.
    From the content of the error message, it looks like you’ve probably given a model in nnet1 format.
    Is there a file called final.nnet other than final.mdl? If final.nnet exists, you should specify –nnet-type=1 instead of –nnet-type=3 because it is a learning recipe for nnet1.

    For details, refer to the following items in HARK-Document.
    https://www.hark.jp/document/hark-document-en/subsec-KaldiDecoder.html

    Best regards,
    HARK Support Team.

    お問い合わせありがとうございます。

    下記URLにファイルフォーマットの仕様が書かれていますので、ご参照ください。
    https://www.hark.jp/document/hark-document-ja/sec-formats.html

    C/C++の実装サンプルで宜しければ、HARKが読み書きに使用しているIOライブラリのlibharkio3のソースコード等も御座います。
    Ubuntuの端末上では、「apt source libharkio3」でダウンロード可能です。
    その他環境でダウンロードされる場合は、下記URLのリンクから最新版をダウンロードしてご利用ください。
    https://www.hark.jp/download/source-code/

    以上、宜しくお願い致します。
    HARKサポートチーム

    お問い合わせありがとうございます。

    > ●質問1
    > 処理分配機能について、ドキュメント(3.1.0)のどのページを見ればよいか、教えていただけませんでしょうか?
    > (目次からそれらしいのがわからず、それらしいキーワードでぐぐっても探せなかったため)

    確認致しましたところ、ドキュメントの更新作業に遅れが発生しており
    十分な情報がまだ公開されていない状況となっております。
    もし宜しければ、別のThreadを立ててPostして頂けませんでしょうか。

    > ●質問2
    > SourceSelectorByDirectionのパラーメータ値(フィルタリングする角度情報)を外部から動的に与えるにはどうすればよいでしょうか?例えば、時刻t1では0-10度、時刻t2では20-30度、時刻t3では70-90度のように、動的に任意の角度を渡したいのですが、その場合、どのようなノードを使えばよいでしょうか?
    > (やりたいことは質問3の具体例部分です)

    SourceSelectorByDirectionは静止した話者方向のみを残すフィルタリングを目的としているため、
    フィルタリングする角度情報を動的に与えることは出来ません。
    HARK-Python等でSource情報を入力してフィルタ方向を決定するノードを実装する必要があります。
    前回の図ではConstantLocalizationを使用されていますが、時間で動的に変化する音源を追跡するという事で宜しいでしょうか?その場合には、LocalizeMUSIC等の定位ノードで音源検出を行う必要があります。
    動的に変化する音源であるが、音源方向が既知であるという場合についても考えましたがマイクアレイからの入力との事でしたので、お使いになる用途について確認させて頂ければと思います。

    > ●質問3
    > SaveWavePCMを複数音源の音声を結合する方法がわからないので教えていただきたい。

    INPUT入力端子は1つですが、複数音源のスペクトルデータが入力されています。
    まず、SaveWavePCMの挙動について説明させて頂きます。
    SOURCES入力端子には音源情報(音源ID、定位結果の座標など)が Vector (C++ の std::vector に相当) で入力されます。また、INPUT入力端子には分離スペクトルが Map(C++ の std::map に相当)で入力されます。つまり、どちらの入力端子でも複数音源のデータを1端子で入力しています。
    SaveWavePCMノードは毎フレーム受け取る Map の同一の Key (音源ID)を1つのファイルに書き出します。つまり、有音区間のデータしか書き出しされません。SOURCES入力端子が接続されている場合は、音源情報に含まれる音源IDだけがファイルに書き出されます。SOURCES入力端子が未接続時は Map に含まれるすべての Key (音源ID)が出力されます。

    無音区間を含めて結合する必要がある場合について:
    soxなどの外部ツールをお使いください。
    SaveSourceLocationノードで音源情報をファイルに出力する事が可能ですので、各音声ファイルの開始/終了フレーム(音声区間)をご確認頂く事が可能です。その時間情報に基づき、sox等の外部ツールを使って結合する事でご希望のファイルを得る事が出来ます。soxの場合、無音に対して音声ファイルの開始時間を与えてMixingしたものをファイルに書き出すのが楽だと思います。

    質問3の最後に書かれていた具体例について:
    既知の音源方向であると仮定して書かせて頂きます。
    前者はt1~t5までが連続しているため音源情報のIDが同一で、音源座標の情報が「 t1=> 5度 =>t2=> 35度 =>t3=> 10度 =>t4=> 75度 =>t5 」と変動していれば1つの音声データとして出力可能です。後者の場合にはt1~t3とt4~t5の2つの区間に分かれてしまっているので2つの音声データとして出力されます。
    既知の特定時間で変動する音源情報を作るためには、次のように作成します。
    まず、IterCountノードで現在のフレームカウント(16000Hzサンプリング、ADVANCEが160サンプルの初期設定では1フレームが10msです。)を取得し、これとConstantノードで与える定数(何フレーム目で切り替えるか)をGreaterまたはSmallerノードで比較した結果をIFノードの条件(COND端子の入力)とします。各区間での方向を表す座標を与えたConstantLocalizationノードをIFノードのTHEN端子とELSE端子に入力してこれを切り替える回数だけ多段に接続してください。
    また、前者/後者の2つの音源情報をCombineSourceノードで結合し、SOURCES端子の入力とします。
    *)別件ですが、Wordpress原因で図が添付できない問題が解決しましたので、ご連絡させて頂きます。テキストだと分かりにくいかと思われますので、後ほどサンプルを添付させて頂きます。

    > ●質問4
    > 質問3の具体例のような処理を行う場合に必要となるPCのスペックを検討しています。
    > 上記の処理は主にビームフォーミング処理と音声結合処理から構成されますが、どの程度のスペックのPCで各々の計算時間がどの程度になるのか、知見がございましらご教示頂けないでしょうか?

    毎年、HARK講習会を開催しておりますが来訪者の方には下記スペックのPCを準備して頂いております。
    プロセッサ:Core iシリーズ (メモリ:4GB以上搭載、SSD搭載 を推奨)

    ビームフォーミング処理等は使用するアルゴリズムやパラメータで計算時間が異なりますので具体的な時間は申し上げにくいのですが、上記スペックのPCであればリアルタイムに処理を行うことが出来ます。
    オフライン(ファイル入力)では実時間より短くなりますが、実際に処理を行って確認して頂く必要があります。


    投稿タイトルと異なる内容のご質問となる場合(例えば 質問1 や 質問4 のような場合)は、別のThreadに分けて投稿して頂いた方が他の方からも回答が付きやすくなります。ご検討ください。

    以上、宜しくお願い致します。
    HARK Support Team,

    お問い合わせありがとうございます。

    > ソケット通信でアレイマイクの音声を送信して、受信側で任意の方向ごとに音声を分離して出力したいと考えています。実現可能か?また実現方法について下記3点についてご質問させてください。

    実現可能です。実現方法は複数あります。

    • HarkDataStreamSenderの出力を受信するノードを作る(C++/Pythonは問わない)
    • 受信側ネットワークファイルの最初のノードをAudioStreamFromMicにして、デバイスタイプにNETWORKを選択する
       送信側の仕様については下記URLに記述がありますが、IEEE float形式のrawデータを送信するだけですのでシンプルな実装で済みます
       動作確認は、arecordをIEEE float形式(FLOAT_LE)で実行し、pipeでtcpdump(HARKのAudioStreamFromMic宛て)に送るだけで動きます(TCP/IPセッションの管理などのために、実際の運用ではアプリを書かれた方が良いと思います)
       https://www.hark.jp/document/hark-document-ja/subsec-AudioStreamFromMic.html

    「ソケット通信で」の部分が重要でなければ下記の候補もご検討ください。

    • HARK-ROSのPublisher/Subscriberを使用する(ROSの知識が必要になります)
    • HARK 3.1 から処理分配機能が追加されましたので、ノードを実行するホストを変更する事で処理を振り分ける(現在、HARK 3.1はUbuntu版のみリリースしております)
       Windows環境の場合は、VMwareやVirtualBox等でUbuntuのVirtualMachine環境を準備する必要があります

    > (1) HarkDataStreamSenderのデータを受信するための既存ノードの有無
    > HarkDataStreamSenderのデータを受信するためのノードはありますでしょうか?自作するしかないのでしょうか?

    HarkDataStreamSenderはHARKの出力を外部アプリケーションで受信できるようにするために作成されたノードですので、受信側のノードは準備しておりません。

    > (2) hark windowsの独自ノード作成の可能性
    > 自作の場合、FAQに「HARK Windowsでの独自ノードの追加はサポートされていません。」とありました。

    Windows版のHARKでも、HARK-Python3を用いたPython実装で独自ノードを作成する事は可能です。
    Windows版のHARKでは、MSYS2やAnaconda等の複合環境を用いてビルドする関係で環境構築の難しさからソースコードに改変が必要な箇所などを含め情報を開示しておりません。つまり、C++実装による独自パッケージのビルド環境がユーザー様側で容易に構築できないためサポートしていないという表記となっております。

    > (3) 音声ファイル出力について
    > 図中のWindows側で、指定した方向の音声だけを受信したい場合で、例えば、0〜10度、90-120度の音声をそれぞれのファイルに出力するということは可能でしょう?(ドキュメントを読むと同一PC上だとできそうな気がするのですが、ソケット通信後でもできますでしょうか?)

    ソケット通信と関係なく可能です。
    SaveWavePCMノードのSOURCES(音源情報)入力端子の前段に、方位角のフィルタのためにSourceByDirectionノード(0~10度と90~120度の範囲に設定した2つを準備します)、および複数音源情報の結合にはCombineSourceノードを用いてください。
    SaveWavePCMノードのファイル名にタグを付与する機能で角度値をファイル名に埋め込むことが可能です。
    https://www.hark.jp/document/hark-document-ja/subsec-SaveWavePCM.html
    https://www.hark.jp/document/hark-document-ja/subsec-SourceSelectorByDirection.html
    https://www.hark.jp/document/hark-document-ja/subsec-CombineSource.html

    以上、宜しくお願い致します。
    HARK Support Team

    in reply to: Automating HARK input with Batch Process #1497

    Thank you for your inquiry.

    First, create a network file for file input using AudioStreamFromWave . This is a normal network file that takes one WAV file as input. Please refer to Cookbook and Samples for how to create a network file.
    Next, change the parameter type of the Constant node that is inputting the file name from string to subnet_param , and change the parameter value to ARG1 or string:ARG1 . Please refer here for the meaning of ARG<number> .
    With this change, you can change the file name arbitrarily with the argument, so you can execute as follows.

    If you want a network file named network.n to process a WAV file named input.wav:

    
    harkmw ./network.n ./input.wav
    

    After that, just write the loop of the file name as follows with shell script.

    If you have a file list:

    
    for f in <code>cat filelist.txt</code>; do
      harkmw ./network.n ${f};
    done
    

    Of course, you can also do the following.

    
    for f in your_path/*.wav; do
      harkmw ./network.n ${f};
    done
    

    Note:
    Generally, you should also change the output file. If you forget your changes, they will be overwritten during the loop. Do the same with parameters that set the output filename (or parameters that affect the output filename) for SaveWavePCM or Save...(your save node name)... in a similar way to the input file. The difference is that it uses ARG2 which means the second argument.

    Best regards,
    HARK support team

    in reply to: HARk gui error #1495

    Hello

    Thank you for your inquiry.

    From the information in the screenshot I saw that the machine with HARK installed appeared to be separate from the machine it was working on, making a remote connection. If you have a remote connection, please try the following steps.

    The behavior when no options are given to the hark_designer command is to start the HARK-Designer server, then start the browser and connect as a client. That is, it tries to boot for use on the local machine.

    Step1:
    When making a remote connection, it is necessary to start up only the HARK-Designer server, so it is necessary to start it as follows.

    
    hark_designer allowremote
    

    Note:
    If port number 3000 is not available (for example, another application is using it), you need to change the port number.
    If you need to change the port number used to connect HARK-Designer from the initial value of 3000, give the environment variable as follows and start hark_designer.

    If you want to set the port number to 4000:

    
    PORT=4000 hark_designer allowremote
    

    Step2:
    After the server is up, launch a browser (Firefox, Chrome, etc.) on the machine you are working on and connect to the machine where HARK is installed.

    If the port number is 4000 and the IP is 11.22.33.44 then:

    
    http://11.22.33.44:4000/
    

    Best regards,
    HARK support team

    in reply to: HARK connection with KALDI GUI #1459

    All samples we provide from the download page have been confirmed to be executable in advance. First of all, let’s check what is the cause.

    Step 1: After extracting the downloaded sample file, please execute according to the included readme_en.txt without changing any files.
    If it does not work at this stage, you have failed to install HARK and KaldiDecoder. Check the installation method and try the installation process again.

    Step 2: Overwrite final.mdl under the kaldi_conf/chain_sample/tdnn_5b/ directory with final.mdl of your acoustic model. And replace the HCLG.fst , phones.txt , word.txt , and phones/ directory's files under the kaldi_conf/chain_sample/tdnn_5b/graph_multi_a_tri5a_fsh_sw1_tg/ directory with the graph files of your language model.
    You may see an error message when performing the steps of “(1) Launch Kaldi” written in readme_en.txt. The error message usually describes the cause of the crash. If you use iVector, you need to replace the files under kaldi_conf/chain_sample/extractor with the iVectorExtractor generated when training your model. If you do not use iVector, you need to delete the "--ivector-extraction-config=kaldi_conf/ivector_extractor.conf" line in the contents of kaldi_conf/online.conf . Furthermore, the number of contexts written in kaldi_conf/conf/splice.conf may be different from when you trained your acoustic model. In that case, it needs to be modified. These are determined by your acoustic model training settings.
    If you are getting the error message continuously here, please provide a screenshot of the error message. If the error message disappears, KaldiDecoder has started successfully. You can work with HARK by matching the features in the next step.

    Step 3: If you execute “(2) Execute HARK” in readme_en.txt as it is, KaldiDecoder will crash with an error message that the dimensions are different. If the settings of splice and sub-sampling-factor are appropriate, it is possible to cope by matching the dimension of the feature and changing the type of feature.
    In the sample provided by us, the feature’s number of dimensions is set to 40. Please change it according to the number of dimensions of the features used for training your acoustic model.
    Note: This sample set includes two network files. One is practice2-2-2.n for online that is executed in real time with a microphone array, and the other is practice2-2-2_offline.n for offline (also processing with a WAV file recorded with microphone arrays). Both are set for TAMAGO microphone arrays. We recommend that you first test using the offline version.

    Step 4: If no error message is displayed, but the recognition result is incorrect, check the following. We recommend MSLS features that can be generated by HARK for speech recognition, but they are not common. If created using the usual procedure in Kaldi, MFCC features should be used. practice2-2-2.n and practice2-2-2_offline.n use the MSLSExtraction node. By changing the MSLSExtraction node of the network to the MFCCExtraction node using HARK-Designer, it is possible to connect correctly with the acoustic model learned with general MFCC features.

    Sincerely,
    HARK Support Team

    in reply to: HARK connection with KALDI GUI #1448

    Hi Riya-san,

    I don’t know the KALDI GUI, so I’ll suggest two solutions and I hope you choose the one that suits your purpose.

    1. How to use a third-party external Kaldi decoder.
    If an external Kaldi decoder requests a PCM stream, it can be obtained in the following way.
    HARK has a node called HarkDataStreamSender, which can obtain PCM data (and localization data if necessary) via Socket.
    Please refer to HarkDataStreamSender for usage.
    In this case, you need to parse the PCM data coming from HARK and format it to match the input of the decoder you use. Many people use small scripts such as Python or node.js for this purpose.

    2. How to use the KaldiDecoder we have provided.
    HARK has a function to convert PCM data to MSLS (or MFCC) features, so it sends a stream of features to KaldiDecoder. Sent from HARK using SpeechRecognitionClient node.

    If you are not sure how to set the file path given to KaldiDecoder, please refer to the following sample file.
    Samples
    HARK_recog_3.0.0_IROS2018_practice2.zip

    The config file included in this sample uses relative paths. Since it is a relative path from the place to execute, we are recommended to use the absolute path when executing from various places.
    For example, if I refer to your ScreenShot, it will be like an attached file. Since the location of the acoustic model (final.mdl) was not known from your ScreenShot, that part is a dummy. You can rewrite it in the same way, so please try it.
    If you are not using iVector in your acoustic model, you need to remove the ivector’s configuration line from the attached config file.

    Note: This sample uses our own MSLS features, so if you want to rewrite this sample and use it, you will need to replace the MSLSExtraction node with the MFCCExtraction node. The MFCC features generated by the MFCCExtraction node are compatible with those used by HTK Toolkit, Kaldi, etc. Please match the number of dimensions and the presence or absence of Delta and Accelerate.

    Sincerely,
    HARK Support Team

    Attachments:
    in reply to: RASP-ZXでの伝達関数測定 #1315

    お問い合わせありがとうございます。

    1.既に書かれていらっしゃるように、RASP-ZXの場合はマイクを自由に配置可能ですので次のような手順で作成します。
    1) 最初に作成するマイク座標ファイルは何を選択しても問題ありません。直線配置であればマイク座標はgridがよさそうです。音源座標は、次の「2.」の回答で書いているように通常はcircleやsphereが良いと思われます。点の数がマイクの個数以上となるように設定して作成します。
    2) Top画面に戻ってから、出来上がったマイク座標ファイルを編集します。「Visualize」というボタンを押すと、右側に現在の配置が描画され、左側に座標リストが表示されます。リストの右側にある丸の中に「-」というボタンを押すと指定行の座標が削除されます。(注:途中のidを削除した場合は連番になるように編集の最後に「reset id」ボタンを押してください。)
    なお、座標の単位は[m]で、(X,Y,Z)=(1,0,0)方向が0度(正面)です。例えば、0度を基準として左右の音源と分離するのであればマイクアレイが15cm間隔ですので、座標上はY軸方向に0.15間隔で並べてください。HARKが出力する角度情報は、X,Y,Zがすべて0となる位置からの角度となりますので、マイクアレイの中心が(X,Y,Z)=(0,0,0)となるようにする事をお勧めします。(注:RASP-ZXは本体から最も遠い末端が1chでRASP-ZXに近づくにつれてch番号が増えます。マイク配置の順番もマイクのch順になるように注意してください。)
    3) Top画面に再度戻ってから、「Download」ボタンで座標ファイルを保存されることをお勧めします。

    2.音源位置は実際に使用される環境に合わせて作成します。テレビのように正面180度にしか話者がいない前提の場合は半円で良いですし、ロボットのように全方位に人がいる場合は360度で作成します。例えば座席に座っている人と後ろに立っている人を分離するようなケース(高さが異なる位置の話者同士を分離したい場合)では球体のように配置すべきです。つまり、用途に合わせて音源があると考えられる位置のリストを作成してください。通常の用途ではcircleやsphere、半径は1m前後で問題ないと思われます。席に座っている場合のみを想定するのであれば半径60cmぐらいでも良いと思われますが、これも実際の用途に合わせてご設定ください。

    3.伝達関数とは音の伝播を表す関数ですので、特定の空間でのマイク位置と音源位置の音の伝わりが分かる(例:遅延、減衰は距離などに起因します)必要があります。つまり、マイク座標と音源座標が分からなければ幾何計算できません。単に収録したPCMデータを指定するためのファイルではないのでご注意ください。逆にTSP収録した場合に座標ファイルが必要になる理由は、その伝播がどの音源位置であるかを結びつけるためにあります。そのため、誤った情報を与えると誤った結果を(正しく?)返します。

    4.ダウンロードできる伝達関数とは、下記のURLからダウンロードできるものでしょうか?もし、その認識で合っていましたら「Other Information (Common for TSP recording and geometric calculation transfer function)」という項目がありますので、ご確認ください。恐らくですが、ここに記載している5度毎72方位(マイクアレイ中心からの仰角16.7度)の円形配置という設定と、作成された際の設定で異なるためと考えられます。ご質問の「2.」で書かれているのは伝達関数作成マニュアルの設定かと思われますが、このマニュアルの説明での作成例ですのでご注意ください。
    https://www.hark.jp/document/supported/

    以上、宜しくお願い致します。

    お問い合わせありがとうございます。

    こちらの投稿 を既にご覧になっているとの事でしたので、マルチチャネルの場合に必要となる情報だけ回答させて頂きます。

    hark_msgs/HarkWavench に送信するチャネル数を設定して頂き、マルチチャネルのPCMデータは wavedata が各チャネルのデータで、 src にチャネル順に格納して頂ければ送信可能です。

    Thomas氏が投稿されたソースコードをお借りするならば、

    
    result = []
    result.append(harkwaveval)
    

    の部分がマルチチャネルの場合は次のようになります。

    
    result = []
    result.append(harkwaveval_ch0)
    result.append(harkwaveval_ch1)
    result.append(harkwaveval_ch2)
    ...
    

    なお、AudioStreamFromRosノードでは下記のように実装しております。C/C++をよく書かれている方でしたら下記のソースコードの方が分かりやすいかもしれません。

    
    for (int k = 0; k < nb_channels; k++) {
      for (int i = 0; i < length; i++) {
        (*output)(k, i) = cbf->deque_wave[0].src[k].wavedata[i];
      }
    }
    

    https://www.hark.jp/download/source-code/
    上記URLでHARKの全ソースコードを公開しておりますので、その他の部分についても実装内容を確認する事が可能です。

    ———-

    data_bytes の件、書き忘れました。全チャネル分になりますのでご注意ください。

    以上、ご参考になれば幸いです。

Viewing 15 posts - 1 through 15 (of 68 total)