This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // M5 Cardputer モノラルで I2S 再生 | |
| #include <Arduino.h> | |
| #include <driver/i2s.h> | |
| #include <math.h> | |
| #define SAMPLE_RATE 44100 // サンプリングレート | |
| #define I2S_PORT I2S_NUM_0 | |
| #define TABLE_SIZE 256 // サイン波のルックアップテーブルサイズ | |
| #define I2S_BCK 41 // BCLK ピン | |
| #define I2S_DATA 42 // DATA ピン |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD | |
| * | |
| * SPDX-License-Identifier: MIT | |
| */ | |
| #include <Arduino.h> | |
| #include <M5Unified.h> | |
| #include <M5ModuleLLM.h> | |
| #include <WiFi.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| # フォントとか色々設定 | |
| font="/System/Library/Fonts/ヒラギノ角ゴシック W3.ttc" | |
| output_path="/tmp" | |
| pointsize=100 | |
| image_size="1024x150" | |
| background_color="black" | |
| fill_color="white" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = "==3.12" | |
| # dependencies = ["mlx==0.21.0", "mlx_vlm"] | |
| # /// | |
| import mlx.core as mx | |
| import numpy as np | |
| from mlx_vlm import load, generate | |
| from mlx_vlm.prompt_utils import apply_chat_template | |
| from mlx_vlm.utils import load_config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <stdio.h> | |
| #include "esp_system.h" | |
| #include "freertos/FreeRTOS.h" | |
| #include "freertos/task.h" | |
| #include "mqtt_client.h" | |
| #define BROKER_HOST "io.adafruit.com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fs from 'fs'; | |
| import OpenAI from 'openai'; // 最新版ではこの形式を使用します | |
| import dotenv from 'dotenv'; | |
| // 環境変数を読み込む | |
| dotenv.config(); | |
| const openai = new OpenAI({ | |
| apiKey: process.env.OPENAI_API_KEY, // API キーを環境変数から取得 | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { RealtimeClient } from '@openai/realtime-api-beta'; | |
| import fs from 'fs'; | |
| import wav from 'wav'; | |
| import Speaker from 'speaker'; | |
| import { PassThrough } from 'stream'; | |
| const client = new RealtimeClient({ | |
| apiKey: process.env.OPENAI_API_KEY, | |
| model: 'gpt-4o-mini-realtime-preview-2024-12-17', // モデルを指定 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef LINUX_BUILD | |
| #include <driver/i2s.h> | |
| #include <opus.h> | |
| #endif | |
| #include <esp_event.h> | |
| #include <esp_log.h> | |
| #include <string.h> | |
| #include "main.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ESP-IDF v5.5.0 | |
| // ESP32S3 | |
| // SPI PSRAM (ESP-PSRAM64H) is used. | |
| #include <stdio.h> | |
| #include "driver/spi_master.h" | |
| #include "driver/gpio.h" | |
| #include "freertos/FreeRTOS.h" | |
| #include "freertos/task.h" | |
| #include "esp_log.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <SPI.h> | |
| // ESP-PSRAM64H | |
| // 1:CS Input Chip select signal(Active low) | |
| // 2:SO/SIO[1] I/O Serial output | |
| // 3:--/SIO[2] | |
| // 4:VSS Ground | |
| // 5:SI/SIO[0] I/O Serial input | |
| // 6:CLK Input Clock signa |