Home›Local LLM / Open Models›黒電話を分解して、ローカルLLM×ずんだもんと通話できるマルチモーダルAIシステムを作ってみた➁
黒電話を分解して、ローカルLLM×ずんだもんと通話できるマルチモーダルAIシステムを作ってみた➁

黒電話を分解して、ローカルLLM×ずんだもんと通話できるマルチモーダルAIシステムを作ってみた➁This follow-up article details the construction of a multimodal AI system that…

元記事を読むRead original articleqiita.com(新しいタブで開きます)(opens in a new tab)
AI要点サマリSummary highlight

黒電話(600-A2-CL)を物理インターフェースとして活用し、ローカルLLMとずんだもん音声合成を組み合わせた学園祭向けマルチモーダルAIシステムの構築続編を解説している。

This follow-up article details the construction of a multimodal AI system that uses a disassembled vintage rotary phone as a physical interface connected to a local LLM and the Zundamon voice synthesizer, targeting festival exhibition use.

本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (qiita.com) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (qiita.com).

要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.

黒電話600-A2-CLを物理インターフェースとして使い、ローカルLLMとずんだもんの音声合成を組み合わせた、学園祭向けマルチモーダルAIシステムの構築続編である。今回はDiscord Botの録音処理と、受話器やダイヤルに連動する通話動作が中心となる。

黒電話をトリガーに

このシステムでは、黒電話のアナログな物理アクションを会話のトリガーとしている。受話器を上げたタイミングでBotがボイスチャンネルに参加し、利用者がダイヤルを回すと、掛けた番号に応じたキャラクターのWelcomeボイスを再生する。ラズパイカメラモジュールによる画像認識では、性別や服装を取得する構成も示されている。

Bot録音の実装

Bot録音には、@projectdysnomia/dysnomiaを使わず、@discord.js/voiceでパケットを受信する方法を組み込んでいる。一方、受信データの復号化には@snazzah/daveyが引き続き必要とされる。使用構成として、@discordjs/opusの^0.10.0、@discordjs/voiceの^0.19.2、@snazzah/daveyの^0.1.12が挙げられている。

PCMへのデコード

当初は、Discordから受信したopusをprism-opusDecoderへ渡し、そのまま.oggにしてWhiperへ送る経路を試したが、砂嵐しか得られなかった。受信したopusフレームは圧縮されたPCMであり、oggコンテナではないため、必要な情報が不足した状態で.oggへ変換しても正しい音声にならないと説明されている。

ffmpegへの入力

最終的には、opusをprism-opusDecoderで生PCMの.raw形式へデコードし、ffmpegで.wavに変換してからWhiperへ渡す経路を採用した。生PCMへのデコードを挟むことで、音声データを安定してffmpegへ流せるようになったとしている。

Multimodal AI system

This follow-up details the construction of a multimodal AI system built around a disassembled vintage rotary phone, the 600-A2-CL, connected to a local LLM and the Zundamon voice synthesizer. Intended for a festival exhibition, it turns the phone’s analog physical actions into triggers for a conversation with Zundamon.

The system also incorporates image recognition through a Raspberry Pi camera module to obtain information about gender and clothing. This installment continues from earlier work and focuses on implementing the Discord Bot.

Discord Bot implementation

The previous installment found a way to record Bot audio with Node.js. Instead of using the introduced @projectdysnomia/dysnomia library, the implementation receives packets through @discord.js/voice and incorporates that approach directly into the system.

Decryption with @snazzah/davey remains necessary. The listed dependencies include @discordjs/opus version 0.10.0, @discordjs/voice version 0.19.2, and @snazzah/davey version 0.1.12.

PCM and ffmpeg

The unsuccessful audio path sent Discord audio through opus, prism-opusDecoder, an .ogg file, and then Whiper. The received opus frames are compressed PCM rather than an ogg container, so they lack the information required for direct conversion. The result of converting them directly to .ogg was only noise.

The working path instead sends Discord audio through opus and prism-opusDecoder, decodes it into raw PCM, passes it through ffmpeg to create a .wav file, and then sends that output to Whiper. Adding the raw PCM decoding stage allowed the audio to be passed into ffmpeg reliably.

Rotary phone actions

The Bot joins a voice channel when the rotary phone’s handset is lifted. The interaction then combines several physical and audio actions: the user lifts the handset, turns the dial, and hears a character-specific welcome voice determined by the number dialed. This sequence provides the physical trigger for beginning the conversation with Zundamon.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPokoDiscordの音声をそのまま.oggにしたら砂嵐で、生PCMを挟むとうまくいったのはなぜ?Why did the Discord audio turn into static as an .ogg file, but work after decoding it to raw PCM?
  2. TECHガイドTECH Guide本文では、受信したopusフレームは完全なoggコンテナではなく、情報不足だったそうじゃ。PCMは加工前に近い音声データ、くらいの意味じゃよ。The article says the received Opus frames weren’t a complete Ogg container, so key information was missing. Think of PCM as audio data in a more raw form.
  3. ポコPokoじゃあ学園祭のお客さんは、昔の電話で番号を回すと、選んだキャラにつながる感覚で楽しめるの?So festival visitors can dial the old phone and feel like they’re calling the character they chose?
  4. TECHガイドTECH Guide紹介された仕組みでは、受話器を上げるとBotが通話に入り、回した番号に応じたキャラのWelcome音声が流れるんじゃ。In this setup, lifting the handset brings the bot into the voice channel, and the dialed number determines which character’s welcome message plays.
  5. ポコPokoつまり、受話器とダイヤルの動きを入口にして、AIキャラとの会話を始める仕組みなんだね!Got it—the handset and rotary dial become the controls for starting a conversation with an AI character!
  6. TECHガイドTECH Guideそうじゃのう。ただし実装では音声の復号が引き続き必要で、生PCMからffmpegで.wavへ渡す流れが安定したとされておる。Exactly. One caveat in the write-up is that audio decryption is still required; decoding to raw PCM and then sending it through ffmpeg to .wav proved stable.
記事情報・収集記録Article details & collection record
出典Source
Qiita LLMコミュニティCommunity
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
ブログBlog
原文言語Source language
JA
重要度の位置づけImportance in this lane
MediumMedium priority(Local LLM / Open Models 238件中、同等以上 191件)(191 of 238 Local LLM / Open Models entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
2.0 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
中期 (チュートリアル)Medium-term (tutorial)

🏠Local LLM / Open Models の他の記事More from Local LLM / Open Modelsもっと見る →View more →

ページ上部へScroll to top