PI PINは、1日中24時間すべて着用できるAIピンで、持っている会話を記録し、生成AIを使用して要約してメモを取ることができます。
Pi Pinは完全にオープンソースで手頃な価格で、マイクとバッテリーを備えた15ドルのRaspberry Pi Zero 2 Wの上に構築されています。
それは完全にハッキング可能であり、あなたはそれにあなた自身のアプリケーションを書くことができます。
Pi Pinのエンクロージャーは、Raspberry Pi Zero、Microphone、およびBatteryを中心に設計されており、(比較的)コンパクトな物理的寸法を確保しています。
電子機器は意図的に最小限に抑えられ(PI、マイク、バッテリー、バッテリー充電モジュール)、ほとんどの部品は3D印刷可能であるか、既製の製品として利用可能です。
以下のグラフは、PIピンに必要なすべての配線を示しています。
| から | に |
|---|---|
| スライドスイッチ右ピン | PI 5V(ピン2) |
| スライドスイッチ中央のピン | パワーモジュール5V + |
| パワーモジュール5V- | PI GND(ピン6) |
| パワーモジュール3.7V + | バッテリー + |
| パワーモジュール3.7V- | バッテリー - |
| MIC GND | PI GND(ピン6) |
| マイク3V | PI 3.3V(ピン1) |
| MIC BCLK | PI PCM 18(ピン12) |
| MIC LRCL | PI PCM 19(ピン35) |
| マイクデウト | PI PCM 20(ピン38) |
バッテリー:
バッテリーソリューションとして電源モジュールを備えた3.7V 600MAH 702030リチウムバッテリーを使用します。電源モジュールは、バッテリー充電コントローラーやDC/DCコンバーターのように動作します。
通常、ワイヤ接続には、下のグラフが必要です。 3.7Vリチウムバッテリー+を電源モジュールバッテリー+および3.7Vリチウムバッテリーに接続できます-電源モジュールバッテリー- (右のグラフのように)。
その後、Powerモジュール5V +および-で一定の5V出力があります。
Powerモジュールは、バッテリーを充電するためのUSB-Cポートも提供します。
また、パワーモジュール5V +とPI 5Vヘッダーの間にスイッチパネルスライドスイッチを追加します。これにより、ピンシステム全体をオン /オフにします。
マイクロフォン:
AdaFruit I2S MEMSマイクをマイクモジュールとして使用しています。以下のグラフは、マイクをRaspberry Piに配線する方法を示しています。グラフは、大きなRaspberry Piを使用したマイク配線を示していますが、GPIOヘッダーはPi Pinで使用したRaspberry Pi Zeroと同じです。
ケースアセンブリ:
ここで3D印刷された部品を見つけることができます(ステップファイル)。上部はRaspberry Pi Zeroの周りに設計されており、下部はマイク、バッテリー、電源モジュール、スイッチを含む設計されています。すべてのモジュールはケース内に完全にフィットする必要があり、テープまたは接着剤を使用して安定している必要もあります。
下に左のグラフは、ケースのモジュール(配線なし)フィッティングを示しています。
下に左折したグラフは、ケースのモジュール(配線)のフィッティングを示しています。
次に、2つの部分を組み合わせて、4つのM1x7mmネジを使用して固定できます。
RaspbianまたはRaspbian Liteから始める必要があります。 Raspberry PIダウンロードページから最新バージョンを取得し、次の手順に従ってSDカードにOSイメージをインストールします。
piを更新します
sudo apt-get -y update
sudo apt-get -y upgradesudo pip install --upgrade adafruit-python-shell
git clone https://github.com/liltom-eth/pi-pin.git
cd pi-pin/scripts
sudo python i2smic.pyスクリプトを実行すると、構成のオプションが表示されます。
PIモデルを自動的に検出する必要があります。
I2S MICモジュールのサポートをブートでロードする必要がある場合は、ここで[はい]を選択してください。それ以外の場合は、使用するたびにモジュールを手動でインストールする必要があります。
設定が有効になるには、再起動する必要があります。
sudo reboot次のコマンドを使用して、利用可能な入力デバイスをリストします。
arecord -lこれに類似した情報を含むカードエントリが表示されます。
カード番号に注意してください。上のスクリーンショットでは0です。このコマンドを使用して、Monoで6秒のWAVファイルを記録できます(上記のカード番号を一致させるように-plughwパラメーターを変更します):
arecord -D dmic_sv -c2 -r 44100 -f S32_LE -t wav -V mono -v file.wav --duration=6スピーカーがPIに接続されている場合は、デバイスでファイルを直接再生することができます。
aplay file.wav
または、再生のためにコンピューターにコピーすることもできます。
AlsamixerとAlsa Configを介してマイクにボリュームコントロールを追加できます。
sudo apt-get install vim
vim ~ /.asoundrc以下を入れます。
# This section makes a reference to your I2S hardware, adjust the card name
# to what is shown in arecord -l after card x: before the name in []
# You may have to adjust channel count also but stick with default first
pcm.dmic_hw {
type hw
card sndrpii2scard
channels 2
format S32_LE
}
# This is the software volume control, it links to the hardware above and after
# saving the .asoundrc file you can type alsamixer, press F6 to select
# your I2S mic then F4 to set the recording volume and arrow up and down
# to adjust the volume
# After adjusting the volume - go for 50 percent at first, you can do
# something like
# arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v myfile.wav
pcm.dmic_sv {
type softvol
slave.pcm dmic_hw
control {
name " Boost Capture Volume "
card sndrpii2scard
}
min_dB -3.0
max_dB 30.0
}ボリュームを変更する前に、デバイスを1回使用する必要があります(これはALSAのものです)
走る:
arecord -D dmic_sv -c1 -r 48000 -f S32_LE -t wav -V mono -v file1.wav --duration=6これで、 Alsamixerを実行できます-F6を押して、I2Sサウンドカードを選択できます
再生コントロールはありません(録音のみであるため)。
F4を押してキャプチャモードに切り替えると、上下の矢印キーでボリュームを調整できるはずです。
再起動後に~/.asoundrcが消えることがあります。raspi raspi-configをセットアップして、デスクトップの起動ではなくコンソールに起動する必要があります。
sudo raspi-configPythonスクリプトを介してオーディオを記録するには、これらの依存関係をインストールする必要があります。
sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
sudo pip install pyaudiopython record_on_boot.py --output_folder ./recordingバッテリー電源を備えたウェアラブルとしてPi Zeroを実行するため、ゼロ電源がオンになったときにPythonスクリプトを開始する方法が必要です。
/lib/systemd/system/ 、たとえば、次のコンテンツを含むpipin.serviceでサービスファイルを作成します。
sudo vim /lib/systemd/system/pipin.service以下を入れます。
Description=Record on Boot
After=sound.target alsa-state.service
[Service]
User=tom
Type=simple
ExecStart=/usr/bin/python /home/tom/projects/pi-pin/record_on_boot.py --output_folder /home/tom/projects/pi-pin/recording/
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target Userを変更し、独自の名前とスクリプトパスにExecStart 。
ファイルの許可を変更し、起動時にサービスを開始できるようにします。
sudo chmod 644 /lib/systemd/system/pipin.service
sudo systemctl start pipin.service
sudo systemctl enable pipin.serviceデバッグの場合、 sudo systemctl status pipin.serviceを使用してステータスを確認し、 journalctl -u pipin.serviceを使用して出力ログを確認できます。
サービスを手動で停止するには、 sudo systemctl stop pipin.serviceを使用します。
スクリプトを使用する前に、要約を取得するデバイスにOpenAIクライアントの依存関係をインストールする必要がある場合があります。ラップトップを使用して、これらのAIエンドポイントを呼び出しています。
pip install -r requirements.txt summarize.ipynb 、Speech2TextにOpenAI whisperを使用した例を示し、 OpenAI gpt4を使用して会話の転写を要約します。
これは./recording/wav_2024_03_20-065147_PM.wav Tech Newsを聴くPi-Pinを着たときに得た要約です(オーディオ録音は見つけることができます。
The report discusses the significant comeback of tech conferences in the Bay Area, focusing on a particularly large event in downtown San Jose centered around artificial intelligence. Tens of thousands of attendees created a scene reminiscent of a major concert outside the SAP Center, highlighting the immense interest and investment in AI. NVIDIA's GTC convention is spotlighted as a major contributor to this momentum, drawing a crowd of around 20,000 people and significantly benefiting local businesses. NVIDIA CEO Jensen Wang spoke on the transformative impact of AI across various industries, emphasizing the computer as a crucial societal tool. The event has led to a notable economic boost for the area, with restaurants and venues experiencing high demand. This resurgence of tech conferences is likened to the phenomenon of "revenge travel" post-COVID lockdowns, indicating a strong desire within the tech community to reconnect, explore new technologies, and invest in the industry's future.
転写と要約は./recording/フォルダーにもあります。