file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
main/led/circular_strip.h
C/C++ Header
#ifndef _CIRCULAR_STRIP_H_ #define _CIRCULAR_STRIP_H_ #include "led.h" #include <driver/gpio.h> #include <led_strip.h> #include <esp_timer.h> #include <atomic> #include <mutex> #include <vector> #define DEFAULT_BRIGHTNESS 32 #define LOW_BRIGHTNESS 4 struct StripColor { uint8_t red = 0, green = 0, blue = 0; }; c...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/led/gpio_led.cc
C++
#include "gpio_led.h" #include "application.h" #include "device_state.h" #include <esp_log.h> #define TAG "GpioLed" #define DEFAULT_BRIGHTNESS 50 #define HIGH_BRIGHTNESS 100 #define LOW_BRIGHTNESS 10 #define IDLE_BRIGHTNESS 5 #define SPEAKING_BRIGHTNESS 75 #define UPGRADING_BRIGHTNESS 25 #define ACTIVATING_BRIGHTNES...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/led/gpio_led.h
C/C++ Header
#ifndef _GPIO_LED_H_ #define _GPIO_LED_H_ #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include "led.h" #include <driver/gpio.h> #include <driver/ledc.h> #include <esp_timer.h> #include <atomic> #include <mutex> class GpioLed : public Led { public: GpioLed(gpio_num_t gpio); GpioLed(gpio_num_t gp...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/led/led.h
C/C++ Header
#ifndef _LED_H_ #define _LED_H_ class Led { public: virtual ~Led() = default; // Set the led state based on the device state virtual void OnStateChanged() = 0; }; class NoLed : public Led { public: virtual void OnStateChanged() override {} }; #endif // _LED_H_
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/led/single_led.cc
C++
#include "single_led.h" #include "application.h" #include <esp_log.h> #define TAG "SingleLed" #define DEFAULT_BRIGHTNESS 4 #define HIGH_BRIGHTNESS 16 #define LOW_BRIGHTNESS 2 #define BLINK_INFINITE -1 SingleLed::SingleLed(gpio_num_t gpio) { // If the gpio is not connected, you should use NoLed class asser...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/led/single_led.h
C/C++ Header
#ifndef _SINGLE_LED_H_ #define _SINGLE_LED_H_ #include "led.h" #include <driver/gpio.h> #include <led_strip.h> #include <esp_timer.h> #include <atomic> #include <mutex> class SingleLed : public Led { public: SingleLed(gpio_num_t gpio); virtual ~SingleLed(); void OnStateChanged() override; private: s...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/main.cc
C++
#include <esp_log.h> #include <esp_err.h> #include <nvs.h> #include <nvs_flash.h> #include <driver/gpio.h> #include <esp_event.h> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include "application.h" #include "system_info.h" #define TAG "main" extern "C" void app_main(void) { // Initialize NVS flash...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/mcp_server.cc
C++
/* * MCP Server Implementation * Reference: https://modelcontextprotocol.io/specification/2024-11-05 */ #include "mcp_server.h" #include <esp_log.h> #include <esp_app_desc.h> #include <algorithm> #include <cstring> #include <esp_pthread.h> #include "application.h" #include "display.h" #include "oled_display.h" #in...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/mcp_server.h
C/C++ Header
#ifndef MCP_SERVER_H #define MCP_SERVER_H #include <string> #include <vector> #include <map> #include <functional> #include <variant> #include <optional> #include <stdexcept> #include <thread> #include <mbedtls/base64.h> #include <cJSON.h> class ImageContent { private: std::string encoded_data_; std::string ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/ota.cc
C++
#include "ota.h" #include "system_info.h" #include "settings.h" #include "assets/lang_config.h" #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <cJSON.h> #include <esp_log.h> #include <esp_partition.h> #include <esp_ota_ops.h> #include <esp_app_format.h> #include <esp_efuse.h> #include <esp_efuse_ta...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/ota.h
C/C++ Header
#ifndef _OTA_H #define _OTA_H #include <functional> #include <string> #include <esp_err.h> #include "board.h" class Ota { public: Ota(); ~Ota(); esp_err_t CheckVersion(); esp_err_t Activate(); bool HasActivationChallenge() { return has_activation_challenge_; } bool HasNewVersion() { return h...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/protocols/mqtt_protocol.cc
C++
#include "mqtt_protocol.h" #include "board.h" #include "application.h" #include "settings.h" #include <esp_log.h> #include <cstring> #include <arpa/inet.h> #include "assets/lang_config.h" #define TAG "MQTT" MqttProtocol::MqttProtocol() { event_group_handle_ = xEventGroupCreate(); // Initialize reconnect tim...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/protocols/mqtt_protocol.h
C/C++ Header
#ifndef MQTT_PROTOCOL_H #define MQTT_PROTOCOL_H #include "protocol.h" #include <mqtt.h> #include <udp.h> #include <cJSON.h> #include <mbedtls/aes.h> #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #include <esp_timer.h> #include <functional> #include <string> #include <map> #include <mutex> #includ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/protocols/protocol.cc
C++
#include "protocol.h" #include <esp_log.h> #define TAG "Protocol" void Protocol::OnIncomingJson(std::function<void(const cJSON* root)> callback) { on_incoming_json_ = callback; } void Protocol::OnIncomingAudio(std::function<void(std::unique_ptr<AudioStreamPacket> packet)> callback) { on_incoming_audio_ = ca...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/protocols/protocol.h
C/C++ Header
#ifndef PROTOCOL_H #define PROTOCOL_H #include <cJSON.h> #include <string> #include <functional> #include <chrono> #include <vector> struct AudioStreamPacket { int sample_rate = 0; int frame_duration = 0; uint32_t timestamp = 0; std::vector<uint8_t> payload; }; struct BinaryProtocol2 { uint16_t v...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/protocols/websocket_protocol.cc
C++
#include "websocket_protocol.h" #include "board.h" #include "system_info.h" #include "application.h" #include "settings.h" #include <cstring> #include <cJSON.h> #include <esp_log.h> #include <arpa/inet.h> #include "assets/lang_config.h" #define TAG "WS" WebsocketProtocol::WebsocketProtocol() { event_group_handle...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/protocols/websocket_protocol.h
C/C++ Header
#ifndef _WEBSOCKET_PROTOCOL_H_ #define _WEBSOCKET_PROTOCOL_H_ #include "protocol.h" #include <web_socket.h> #include <freertos/FreeRTOS.h> #include <freertos/event_groups.h> #define WEBSOCKET_PROTOCOL_SERVER_HELLO_EVENT (1 << 0) class WebsocketProtocol : public Protocol { public: WebsocketProtocol(); ~Webs...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/settings.cc
C++
#include "settings.h" #include <esp_log.h> #include <nvs_flash.h> #define TAG "Settings" Settings::Settings(const std::string& ns, bool read_write) : ns_(ns), read_write_(read_write) { nvs_open(ns.c_str(), read_write_ ? NVS_READWRITE : NVS_READONLY, &nvs_handle_); } Settings::~Settings() { if (nvs_handle_ !...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/settings.h
C/C++ Header
#ifndef SETTINGS_H #define SETTINGS_H #include <string> #include <nvs_flash.h> class Settings { public: Settings(const std::string& ns, bool read_write = false); ~Settings(); std::string GetString(const std::string& key, const std::string& default_value = ""); void SetString(const std::string& key, c...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/system_info.cc
C++
#include "system_info.h" #include <freertos/task.h> #include <esp_log.h> #include <esp_flash.h> #include <esp_mac.h> #include <esp_system.h> #include <esp_partition.h> #include <esp_app_desc.h> #include <esp_ota_ops.h> #include <esp_pm.h> #if CONFIG_IDF_TARGET_ESP32P4 #include "esp_wifi_remote.h" #endif #define TAG "...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
main/system_info.h
C/C++ Header
#ifndef _SYSTEM_INFO_H_ #define _SYSTEM_INFO_H_ #include <string> #include <esp_err.h> #include <freertos/FreeRTOS.h> class SystemInfo { public: static size_t GetFlashSize(); static size_t GetMinimumFreeHeapSize(); static size_t GetFreeHeapSize(); static std::string GetMacAddress(); static std::s...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/Image_Converter/LVGLImage.py
Python
#!/usr/bin/env python3 import os import logging import argparse import subprocess from os import path from enum import Enum from typing import List from pathlib import Path try: import png except ImportError: raise ImportError("Need pypng package, do `pip3 install pypng`") try: import lz4.block except Imp...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/Image_Converter/lvgl_tools_gui.py
Python
import tkinter as tk from tkinter import ttk, filedialog, messagebox from PIL import Image import os import tempfile import sys from LVGLImage import LVGLImage, ColorFormat, CompressMethod HELP_TEXT = """LVGL图片转换工具使用说明: 1. 添加文件:点击“添加文件”按钮选择需要转换的图片,支持批量导入 2. 移除文件:在列表中选中文件前的复选框“[ ]”(选中后会变成“[√]”),点击“移除选中”可删除选定文件 3. 设置...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/acoustic_check/demod.py
Python
""" 实时AFSK解调器 - 基于Goertzel算法 """ import numpy as np from collections import deque class TraceGoertzel: """实时Goertzel算法实现""" def __init__(self, freq: float, n: int): """ 初始化Goertzel算法 Args: freq: 归一化频率 (目标频率/采样频率) n: 窗口大小 """ self.f...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/acoustic_check/graphic.py
Python
import sys import numpy as np import asyncio import wave from collections import deque import qasync import matplotlib matplotlib.use('qtagg') from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qtagg import NavigationToolbar2QT as NavigationToolbar # no...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/acoustic_check/main.py
Python
#!/usr/bin/env python3 """ 音频实时监听与绘图系统主程序 基于Qt GUI + Matplotlib + UDP接收 + AFSK解码字符串 """ import sys import asyncio from graphic import main if __name__ == '__main__': try: asyncio.run(main()) except KeyboardInterrupt: print("程序被用户中断") except Exception as e: print(f"程序执行出错: {e}") ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/audio_debug_server.py
Python
import socket import wave import argparse ''' Create a UDP socket and bind it to the server's IP:8000. Listen for incoming messages and print them to the console. Save the audio to a WAV file. ''' def main(samplerate, channels): # Create a UDP socket server_socket = socket.socket(socket.AF_INET, socket....
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/build_default_assets.py
Python
#!/usr/bin/env python3 """ Build default assets based on configuration This script reads configuration from sdkconfig and builds the appropriate assets.bin for the current board configuration. Usage: ./build_default_assets.py --sdkconfig <path> --builtin_text_font <font_name> \ --default_emoji_collection ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/download_github_runs.py
Python
#!/usr/bin/env python3 """ Download GitHub Actions artifacts and rename them with version numbers. Usage: python download_github_runs.py 2.0.4 https://github.com/78/xiaozhi-esp32/actions/runs/18866246016 """ import argparse import os import re import sys import zipfile from pathlib import Path from urllib.parse i...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/gen_lang.py
Python
#!/usr/bin/env python3 import argparse import json import os HEADER_TEMPLATE = """// Auto-generated language config // Language: {lang_code} with en-US fallback #pragma once #include <string_view> #ifndef {lang_code_for_font} #define {lang_code_for_font} // 預設語言 #endif namespace Lang {{ // 语言元数据 conste...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/mp3_to_ogg.sh
Shell
#!/bin/sh # mp3_to_ogg.sh <input_mp3_file> <output_ogg_file> ffmpeg -i $1 -c:a libopus -b:a 16k -ac 1 -ar 16000 -frame_duration 60 $2
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/ogg_converter/xiaozhi_ogg_converter.py
Python
import tkinter as tk from tkinter import ttk, filedialog, messagebox import os import threading import sys import ffmpeg class AudioConverterApp: def __init__(self, master): self.master = master master.title("小智AI OGG音频批量转换工具") master.geometry("680x600") # 调整窗口高度 # 初始化变量 s...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/p3_tools/batch_convert_gui.py
Python
import tkinter as tk from tkinter import ttk, filedialog, messagebox import os import threading import sys from convert_audio_to_p3 import encode_audio_to_opus from convert_p3_to_audio import decode_p3_to_audio class AudioConverterApp: def __init__(self, master): self.master = master master.title("...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/p3_tools/convert_audio_to_p3.py
Python
# convert audio files to protocol v3 stream import librosa import opuslib import struct import sys import tqdm import numpy as np import argparse import pyloudnorm as pyln def encode_audio_to_opus(input_file, output_file, target_lufs=None): # Load audio file using librosa audio, sample_rate = librosa.load(inpu...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/p3_tools/convert_p3_to_audio.py
Python
import struct import sys import opuslib import numpy as np from tqdm import tqdm import soundfile as sf def decode_p3_to_audio(input_file, output_file): sample_rate = 16000 channels = 1 decoder = opuslib.Decoder(sample_rate, channels) pcm_frames = [] frame_size = int(sample_rate * 60 / 1000) ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/p3_tools/p3_gui_player.py
Python
import tkinter as tk from tkinter import filedialog, messagebox import threading import time import opuslib import struct import numpy as np import sounddevice as sd import os def play_p3_file(input_file, stop_event=None, pause_event=None): """ 播放p3格式的音频文件 p3格式: [1字节类型, 1字节保留, 2字节长度, Opus数据] """ #...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/p3_tools/play_p3.py
Python
# 播放p3格式的音频文件 import opuslib import struct import numpy as np import sounddevice as sd import argparse def play_p3_file(input_file): """ 播放p3格式的音频文件 p3格式: [1字节类型, 1字节保留, 2字节长度, Opus数据] """ # 初始化Opus解码器 sample_rate = 16000 # 采样率固定为16000Hz channels = 1 # 单声道 decoder = opuslib.Decoder(sa...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/release.py
Python
import sys import os import json import zipfile import argparse from pathlib import Path from typing import Optional # Switch to project root directory os.chdir(Path(__file__).resolve().parent.parent) ################################################################################ # Common utility functions #########...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/sonic_wifi_config.html
HTML
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8" /> <title>小智声波配网</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style> body { font-family: "Segoe UI", "PingFang SC", sans-serif; background: #f0f2f5; margin: 0; padding: 2rem 1rem; ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/spiffs_assets/build.py
Python
#!/usr/bin/env python3 """ Build the spiffs assets partition Usage: ./build.py --wakenet_model <wakenet_model_dir> \ --text_font <text_font_file> \ --emoji_collection <emoji_collection_dir> Example: ./build.py --wakenet_model ../../managed_components/espressif__esp-sr/model/wakenet_model/wn9_n...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/spiffs_assets/build_all.py
Python
#!/usr/bin/env python3 """ Build multiple spiffs assets partitions with different parameter combinations This script calls build.py with different combinations of: - wakenet_models - text_fonts - emoji_collections And generates assets.bin files with names like: wn9_nihaoxiaozhi_tts-font_puhui_common_20_4-emojis_32....
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/spiffs_assets/pack_model.py
Python
import os import struct import argparse def struct_pack_string(string, max_len=None): """ pack string to binary data. if max_len is None, max_len = len(string) + 1 else len(string) < max_len, the left will be padded by struct.pack('x') string: input python string max_len: output """ ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/spiffs_assets/spiffs_assets_gen.py
Python
# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import io import os import argparse import json import shutil import math import sys import time import numpy as np import importlib import subprocess import urllib.request from PIL import Image from datetime ...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
scripts/versions.py
Python
#! /usr/bin/env python3 from dotenv import load_dotenv load_dotenv() import os import struct import zipfile import oss2 import json import requests from requests.exceptions import RequestException # 切换到项目根目录 os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def get_chip_id_string(chip_id): re...
78/xiaozhi-esp32
24,046
An MCP-based chatbot | 一个基于MCP的聊天机器人
C++
78
Xiaoxia
app.js
JavaScript
// Description: MQTT+UDP 到 WebSocket 的桥接 // Author: terrence@tenclass.com // Date: 2025-03-12 require('dotenv').config(); const net = require('net'); const debugModule = require('debug'); const debug = debugModule('mqtt-server'); const crypto = require('crypto'); const dgram = require('dgram'); const Emitter = require...
78/xiaozhi-mqtt-gateway
105
小智AI的MQTT+UDP服务器,支持后端Websocket程序动态负载均衡
JavaScript
78
Xiaoxia
ecosystem.config.js
JavaScript
module.exports = { "apps": [ { "name": "xz-mqtt", "script": "app.js", "time": true } ] }
78/xiaozhi-mqtt-gateway
105
小智AI的MQTT+UDP服务器,支持后端Websocket程序动态负载均衡
JavaScript
78
Xiaoxia
mqtt-protocol.js
JavaScript
const debug = require('debug')('mqtt-server'); const EventEmitter = require('events'); // MQTT 固定头部的类型 const PacketType = { CONNECT: 1, CONNACK: 2, PUBLISH: 3, SUBSCRIBE: 8, SUBACK: 9, PINGREQ: 12, PINGRESP: 13, DISCONNECT: 14 // 添加 DISCONNECT }; /** * MQTT协议处理类 * 负责MQTT协议的解析和封装,以...
78/xiaozhi-mqtt-gateway
105
小智AI的MQTT+UDP服务器,支持后端Websocket程序动态负载均衡
JavaScript
78
Xiaoxia
utils/config-manager.js
JavaScript
const fs = require('fs'); const path = require('path'); const EventEmitter = require('events'); class ConfigManager extends EventEmitter { constructor(fileName) { super(); this.config = {}; // 移除默认的 apiKeys 配置 this.configPath = path.join(__dirname, "..", "config", fileName); this.loadConfig(); t...
78/xiaozhi-mqtt-gateway
105
小智AI的MQTT+UDP服务器,支持后端Websocket程序动态负载均衡
JavaScript
78
Xiaoxia
utils/mqtt_config_v2.js
JavaScript
require('dotenv').config(); const crypto = require('crypto'); function generatePasswordSignature(content, secretKey) { // Create an HMAC object using SHA256 and the secretKey const hmac = crypto.createHmac('sha256', secretKey); // Update the HMAC object with the clientId hmac.update(content); ...
78/xiaozhi-mqtt-gateway
105
小智AI的MQTT+UDP服务器,支持后端Websocket程序动态负载均衡
JavaScript
78
Xiaoxia
app/boards/sf32lb52-xty-ai-tht/hcpu/custom_mem_map.h
C/C++ Header
/** ****************************************************************************** * @file mem_map.h * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights re...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai-tht/hcpu/rtconfig.py
Python
import os import argparse SIFLI_SDK=os.getenv('SIFLI_SDK') TARGET_NAME = 'bf0_ap' WERROR = True JLINK_DEVICE = 'SF32LB52X_NOR' CORE = "HCPU" CHIP = 'SF32LB52X'
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai-tht/lcpu/custom_mem_map.h
C/C++ Header
/** ****************************************************************************** * @file mem_map.h * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights re...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai-tht/lcpu/rtconfig.py
Python
import os import argparse TARGET_NAME = 'lcpu' CORE = "LCPU" CHIP = 'SF32LB52X'
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai/hcpu/custom_mem_map.h
C/C++ Header
/** ****************************************************************************** * @file mem_map.h * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights re...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai/hcpu/rtconfig.py
Python
import os import argparse SIFLI_SDK=os.getenv('SIFLI_SDK') TARGET_NAME = 'bf0_ap' WERROR = True JLINK_DEVICE = 'SF32LB52X_NOR' CORE = "HCPU" CHIP = 'SF32LB52X'
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai/lcpu/custom_mem_map.h
C/C++ Header
/** ****************************************************************************** * @file mem_map.h * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights re...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai/lcpu/rtconfig.py
Python
import os import argparse TARGET_NAME = 'lcpu' CORE = "LCPU" CHIP = 'SF32LB52X'
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai_base/battery_table.c
C
#include <stdint.h> #include "drv_io.h" // Discharging curve table const battery_lookup_point_t discharge_curve_table[] = { { 100, 41808}, { 99, 41401}, { 98, 41109}, { 97, 40921}, { 96, 40762}, { 95, 40647}, { 94, 40546}, { 93, 40481}, { 92, 40404}, { 91, 403...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai_base/board.h
C/C++ Header
/** ****************************************************************************** * @file board.h * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights rese...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai_base/bsp_board.h
C/C++ Header
/** ****************************************************************************** * @file bsp_board.h * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights ...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai_base/bsp_init.c
C
/** ****************************************************************************** * @file bsp_init.c * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights r...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai_base/bsp_lcd.c
C
#include "bsp_board.h" #ifdef BSP_USING_LCD #define LCD_RESET_PIN (0) // GPIO_A00 #define LCD_BL_PIN (42) // GPIO_A09 /***************************LCD ***********************************/ extern void BSP_PIN_LCD(void); void BSP_LCD_Reset(uint8_t high1_low0) { BSP_GPIO_Set(...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai_base/bsp_pinmux.c
C
/** ****************************************************************************** * @file bsp_pinmux.c * @author Sifli software development team ****************************************************************************** */ /** * @attention * Copyright (c) 2019 - 2022, Sifli Technology * * All rights...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/boards/sf32lb52-xty-ai_base/bsp_power.c
C
#include "bsp_board.h" void BSP_GPIO_Set(int pin, int val, int is_porta) { GPIO_TypeDef *gpio = (is_porta) ? hwp_gpio1 : hwp_gpio2; GPIO_InitTypeDef GPIO_InitStruct; // set sensor pin to output mode GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT; GPIO_InitStruct.Pin = pin; GPIO_InitStruct.Pull = GPIO...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/peripherals/st7789/st7789.c
C
/* * SPDX-FileCopyrightText: 2019-2022 SiFli Technologies(Nanjing) Co., Ltd * * SPDX-License-Identifier: Apache-2.0 */ #include <rtthread.h> #include "string.h" #include "board.h" #include "drv_io.h" #include "drv_lcd.h" #include "log.h" #ifdef ROW_OFFSET_PLUS #define ROW_OFFSET (ROW_OFFSET_PLUS) #else #...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/project/proj.py
Python
# Add BCONF to select board configuration file instead of standard board.conf #BCONF='usb.conf'
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/board/board_hardware.h
C/C++ Header
#ifndef BOARD_HARDWARE_H #define BOARD_HARDWARE_H #include <stdint.h> #include <stdio.h> #ifdef __cplusplus extern "C" { #endif //MCP --led void open_led(); void close_led(); void set_mode_led(); //pinmux void set_pinmux(); //关机 void PowerDownCustom(void); //开机检查 void check_poweron_reason(void); #ifdef __cplusplus } ...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/board/sf32lb52-lcd_n16r8.cc
C++
#include "board_hardware.h" #include "../mcp/rgbled_mcp.h" #include "rtthread.h" #include "drv_io.h" #include "stdio.h" #include "string.h" #include "drivers/rt_drv_pwm.h" #include "bf0_hal.h" #include "bf0_pm.h" #include "xiaozhi_client_public.h" #include "bts2_global.h" #include "bts2_app_pan.h" #include "bt_connecti...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/board/sf32lb52-lchspi-ulp.cc
C++
#include "board_hardware.h" #include "../mcp/rgbled_mcp.h" #include "rtthread.h" #include "drv_io.h" #include "stdio.h" #include "string.h" #include "drivers/rt_drv_pwm.h" #include "bf0_hal.h" #include "bf0_pm.h" #include "xiaozhi_client_public.h" #include "bts2_global.h" #include "bts2_app_pan.h" #include "bt_connecti...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/board/sf32lb52-nano_52j.cc
C++
#include "board_hardware.h" #include "../mcp/rgbled_mcp.h" #include "rtthread.h" #include "drv_io.h" #include "stdio.h" #include "string.h" #include "drivers/rt_drv_pwm.h" #include "bf0_hal.h" #include "bf0_pm.h" #include "xiaozhi_client_public.h" #include "bts2_global.h" #include "bts2_app_pan.h" #include "bt_connecti...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/board/sf32lb52-xty-ai.cc
C++
#include "board_hardware.h" #include "../mcp/rgbled_mcp.h" #include "rtthread.h" #include "drv_io.h" #include "stdio.h" #include "string.h" #include "drivers/rt_drv_pwm.h" #include "bf0_hal.h" #include "bf0_pm.h" #include "xiaozhi_client_public.h" #include "bts2_global.h" #include "bts2_app_pan.h" #include "bt_connecti...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/board/sf32lb52-xty-ai_tht.cc
C++
#include "board_hardware.h" #include "../mcp/rgbled_mcp.h" #include "rtthread.h" #include "drv_io.h" #include "stdio.h" #include "string.h" #include "drivers/rt_drv_pwm.h" #include "bf0_hal.h" #include "bf0_pm.h" #include "xiaozhi_client_public.h" #include "bts2_global.h" #include "bts2_app_pan.h" #include "bt_connecti...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/bt_env.h
C/C++ Header
#ifndef __BT_APP_ENV_H__ #define __BT_APP_ENV_H__ #include "bts2_app_inc.h" #include "ble_connection_manager.h" #include "bt_connection_manager.h" typedef struct { BOOL bt_connected; bt_notify_device_mac_t bd_addr; rt_timer_t pan_connect_timer; } bt_app_t; extern bt_app_t g_bt_app_env; // 声明外部变量 #endif /...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/iot_c_api.cc
C++
#include "iot_c_api.h" #include "thing_manager.h" #include "cJSON.h" #include <rtthread.h> #include <string.h> #include "../mcp/mcp_server.h" static std::string descriptors_json; static std::string states_json; extern "C" { //注册IoT设备(可多个设备) void iot_initialize() { auto& manager = iot::ThingManager::GetInstance();...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/iot_c_api.h
C/C++ Header
#ifndef IOT_C_API_H #define IOT_C_API_H #include <stdint.h> #include <stdio.h> #ifdef __cplusplus extern "C" { #endif void iot_initialize(); void iot_invoke(const uint8_t* data, uint16_t len); // 新增接口 const char* iot_get_descriptors_json(); // 获取所有设备的描述信息 const char* iot_get_states_json(); // 获取所有设备的状态信息 ...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/screen.cc
C++
#include "thing.h" // C 接口头文件 extern "C" { #include <rtthread.h> extern void xiaozhi_ui_update_brightness(int brightness); } // 定义设备名 #define LCD_DEVICE_NAME "lcd" #define TAG "Screen" namespace iot { class Screen : public Thing { private: rt_device_t lcd_device_; // 类成员变量,避免使用全局静态变量 public: Screen() : ...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/speaker.cc
C++
#include "thing.h" // 添加 C 接口头文件 extern "C" { #include "audio_server.h" //#include "../xiaozhi_ui.h" extern void xiaozhi_ui_update_volume(int volume); } #define TAG "Speaker" namespace iot { class Speaker : public Thing { public: Speaker() : Thing("Speaker", "扬声器") { // 定义属性:volume(当前音量值) prope...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/thing.cc
C++
#include "thing.h" #include <rtthread.h> #define TAG "Thing" namespace iot { static std::map<std::string, std::function<Thing*()>>* thing_creators = nullptr; void RegisterThing(const std::string& type, std::function<Thing*()> creator) { if (thing_creators == nullptr) { thing_creators = new std::map<std:...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/thing.h
C/C++ Header
#ifndef THING_H #define THING_H #include <rtthread.h> #include <string> #include <map> #include <functional> #include <vector> #include <stdexcept> #include <cJSON.h> namespace iot { enum ValueType { kValueTypeBoolean, kValueTypeNumber, kValueTypeString }; class Property { private: std::string name_...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/thing_manager.cc
C++
#include "thing_manager.h" #define TAG "ThingManager" namespace iot { void ThingManager::AddThing(Thing* thing) { rt_kprintf("Adding thing: %s\n", thing->name().c_str()); things_.push_back(thing); } std::string ThingManager::GetDescriptorsJson() { std::string json_str = "["; for (auto& thing : thing...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/iot/thing_manager.h
C/C++ Header
#ifndef THING_MANAGER_H #define THING_MANAGER_H #include "thing.h" #include <cJSON.h> #include <vector> #include <memory> #include <functional> #include <map> namespace iot { class ThingManager { public: static ThingManager& GetInstance() { static ThingManager instance; return instance; } ...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/app_recorder_process.c
C
#include <rtthread.h> #include <string.h> #include <stdlib.h> #include "audio_server.h" #include "bsp_et_asr_ctrl.h" #include "lib_et_asr.h" #include "xiaozhi_client_public.h" #include "app_recorder_process.h" #define DBG_TAG "kws" #define DBG_LVL AUDIO_DBG_LVL #include "log.h" #undef app_malloc...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/app_recorder_process.h
C/C++ Header
#ifndef __KWS_APP_RECORDER_PROCESS_H #define __KWS_APP_RECORDER_PROCESS_H #include <stdio.h> #include <stdint.h> void kws_demo(); void kws_demo_stop(); #endif
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/bsp_et_asr_ctrl.c
C
#if 1 //ET_WAKEUP_EN #include <rtthread.h> #include <string.h> #include <stdlib.h> #include "bsp_et_asr_ctrl.h" #include <string.h> #include "bsp_board.h" #include "bf0_sys_cfg.h" #include "lib_et_asr.h" #include "et_asr_default_state.h" #include "et_keyword.h" #include "et_thres_list.h" #include "et_weights.h" #in...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/bsp_et_asr_ctrl.h
C/C++ Header
#ifndef __BSP_ET_ASR_CTRL_H #define __BSP_ET_ASR_CTRL_H #include <stdio.h> #include <stdint.h> #include <lib_et_asr.h> #if 1//ET_WAKEUP_EN void et_bsp_ctrl_main_init(); void et_bsp_ctrl_exit(); unsigned int et_asr_get_time_cnt(); void et_record_q_data_push(int16_t *data, int len); void et_asr_recognition_process();...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_asr_default_state.c
C
#include "et_asr_default_state.h" #if ET_ASR_UI_PRINT_STATES_EN == 1 static const signed char et_d_states_buf[6][480] = { { 0xD5, 0x04, 0x3A, 0x1B, 0x3C, 0xD0, 0x1F, 0xE3, 0xD9, 0xD9, 0x01, 0xE1, 0x09, 0x39, 0xC8, 0xD3, 0x08, 0xFF, 0xCF, 0xF8, 0xBD, 0x43, 0xCE, 0xDE, 0x14, 0xD0, 0xC2, 0xDB, 0x3A, 0x02, 0xD7, 0x2B, 0...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_asr_default_state.h
C/C++ Header
#ifndef _ET_ASR_DEFAULT_STATE_H #define _ET_ASR_DEFAULT_STATE_H #include "lib_et_asr.h" #if ET_ASR_UI_PRINT_STATES_EN == 1 signed char* get_et_d_states_buf_row_p(int row); unsigned char* get_et_d_states_dec_bits_buf_row_p(int row); #endif //ET_ASR_UI_PRINT_STATES_EN #endif //_ET_ASR_DEFAULT_STATE_H
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_collects.h
C/C++ Header
#ifndef ET_ASR_COLLECTS_H #define ET_ASR_COLLECTS_H #include <stdint.h> #define ET_ASR_COLLECTS_BUF_LEN 280 static const int8_t et_asr_collects_buf[ET_ASR_COLLECTS_BUF_LEN] = { 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_decoder_patch.c
C
#include "et_decoder_patch.h" #include <lib_et_asr.h> #include <string.h> #include <stdio.h> extern uint8_t et_units_item2pos(const char* key); extern uint8_t* get_curr_process_word_path(int index); extern int get_et_each_keyword_len_max(void); extern int get_et_chuncksize(void); #define ET_PATCH_USE_EN 0 #define US...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_decoder_patch.h
C/C++ Header
#ifndef DECODER_PATCH_H #define DECODER_PATCH_H #ifdef __cplusplus extern "C" { #endif #include <stdbool.h> #include <stdint.h> int is_et_ui_delay_keyword(int index, uint8_t prefix_flag); int is_et_ui_filter_keyword(int index, uint8_t prefix_flag); int find_phoneme_index(const char *phoneme); i...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_keyword.c
C
#include "et_keyword.h" #define ET_UI_LANG1_KWS_WORDS_TOTAL_NUM 10 const static ET_KWS_PARAM et_ui_kws_param_lang1_list[10] = { { .threshold = 130, .prefix_flag = 255, .major = 1, .kws_value = 1, .label_length = 8, // x iao zh ix x iao zh ix,130,001,1,255 ...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_keyword.h
C/C++ Header
#ifndef ET_ASR_KEYWORD_H #define ET_ASR_KEYWORD_H #include "lib_et_asr.h" int get_et_ui_kws_param_lang1_list_len(); const ET_KWS_PARAM* get_et_ui_kws_param_lang1_list_p(); #endif // ET_ASR_KEYWORD_H
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_kws_labels.h
C/C++ Header
#ifndef ET_ASR_KWS_LABELS_H #define ET_ASR_KWS_LABELS_H #define ET_ASR_KWS_LABELS_BUF_LEN 1536 static const signed char et_asr_kws_labels_buf[ET_ASR_KWS_LABELS_BUF_LEN] = { 0X2f, 0X0e, 0X3f, 0X16, 0X2f, 0X0e, 0X3f, 0X16, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_thres_list.c
C
#include "et_thres_list.h" //#define ET_UI_LANG1_THRES_LIST_BUF_TOTAL_NUM 253 const static unsigned char et_ui_lang1_thres_list_buf[] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0xFF, 0x00, 0x00, 0x00, // line 1 0x02, 0x02, 0x02, 0x02, 0x...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_thres_list.h
C/C++ Header
#ifndef ET_ASR_THRES_LIST_H #define ET_ASR_THRES_LIST_H #include "lib_et_asr.h" unsigned char* get_et_ui_lang1_thres_list_buf_p(); #endif // ET_ASR_THRES_LIST_H
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_weights.c
C
#include "et_weights.h" #define ET_LANG1_WEIGHTS_BUF_LEN 104995 const static char et_lang1_weights_buf[104995] = { 0x26, 0x2D, 0x0E, 0x00, 0x04, 0x02, 0xA0, 0x8A, 0xD7, 0x31, 0x45, 0x1F, 0x15, 0x3B, 0x36, 0x0E, 0x21, 0x1C, 0xFD, 0xE4, 0xD9, 0xDC, 0xCB, 0xD1, 0x1E, 0x0C, 0xE7, 0x0A, 0xEB, 0xE0, 0x02, 0xE3, 0x08, 0...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/et_weights.h
C/C++ Header
#ifndef ET_ASR_WEIGHTS_H #define ET_ASR_WEIGHTS_H #include "lib_et_asr.h" int get_et_lang1_weights_buf_len(); char* get_et_lang1_weights_buf_p(); #endif // ET_ASR_WEIGHTS_H
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/lib_et_asr.h
C/C++ Header
#ifndef _LIB_ET_ASR_H__ #define _LIB_ET_ASR_H__ #ifdef __cplusplus extern "C" { #endif // __cplusplus #if 0 //ndef __linux__ typedef unsigned char u8_et; typedef signed char s8_et; typedef unsigned short u16_et; typedef signed short s16_et; typedef unsigned int uint_et; typedef unsigned long u32_et; typedef signed ...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/kws/third_kws_event.h
C/C++ Header
#ifndef _THIRD_KWS_EVENT_H__ #define _THIRD_KWS_EVENT_H__ #include <stdio.h> #include <stdint.h> #if 1//THIRD_UI_LIGHT_EN typedef enum{ UI_EVENT_START=0x000, UI_EVENT_XIAO_ZHI_XIAO_ZHI, //小智小智 1 UI_EVENT_MAX }action_youjie; #endif // THIRD_UI_LIGHT_EN #endif
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia
app/src/main.c
C
/* * SPDX-FileCopyrightText: 2024-2025 SiFli Technologies(Nanjing) Co., Ltd * * SPDX-License-Identifier: Apache-2.0 */ #include "rtthread.h" #include "bf0_hal.h" #include "drv_io.h" #include "stdio.h" #include "string.h" #include "xiaozhi_websocket.h" #include "./iot/iot_c_api.h" #include <stdbool.h> #ifdef BSP_US...
78/xiaozhi-sf32
160
Build your own AI friend via Bluetooth by SF32
C
78
Xiaoxia