sonicloud_opensdk README

The project's README from github.com/SonicloudTech/sonicloud_opensdk. As one markdown file: README.md.

SoniCloud Recorder SDK

Languages: English | 简体中文

A recorder card and a complete BLE integration reference.

SoniCloud Recorder is an open-source reference project for hardware vendors, software developers, and system integrators. It combines recorder hardware with BLE protocol SDKs, cross-platform integration samples, and a desktop demo to help teams move from device connectivity to recording, transfer, transcription, and product integration.

SoniCloud recorder card

Project overview

The project demonstrates a layered approach to recorder hardware integration: standard BLE commands, a vendor adaptation layer, and cross-platform SDK wrappers. The recorder card captures and stores audio; the SDK manages BLE sessions, protocol traffic, device state, and data streams; the application owns its UI, audio decoding, storage, transcription, and business integration. Differences between chipsets, including service UUIDs, characteristics, packetization, and private commands, remain inside the adapter layer.

What is included

Resource Audience Contents
Mobile SDKs Android, iOS, HarmonyOS, and Flutter developers Platform wrappers, BLE discovery and connection, recording control, real-time audio, file transfer, Wi-Fi, OTA, device information, and event callbacks
Windows/macOS demo Desktop application and tool developers Python BLE protocol implementation, command-line REPL, Web console, and recorder controls
Protocol and test material Teams that need hardware-level customization BLE GATT, frame format, CRC, file downloads, recording events, and compatibility rules
Integration guides Hardware vendors, app teams, and technical reviewers Multiplatform SDK integration and the standard BLE command architecture

Capabilities

Repository layout

sonicloud_opensdk/
├── pnote-android-sdk/                  # Android AAR
├── pnote-ios-sdk/                      # iOS static library and header
├── pnote-harmony-sdk/                  # HarmonyOS HAR SDK
├── pnote-flutter-sdk/                  # Pure-Dart Flutter plugin (BLE protocol, realtime audio stream, docs)
├── pnote-sdk-flutter-demo-main/        # Flutter integration demo (legacy, native-SDK based)
├── pnote-flutter-project/              # Flutter app project (recording + live transcription + AI summary/mind map)
├── pnote-web-win&Mac-demo/             # BLE REPL and Web demo
│   ├── recorder/                       # Protocol, BLE, device session, and Web backend
│   ├── web/                            # Front-end page
│   ├── tests/                          # Protocol and device-simulation tests
│   └── docs/协议.md                    # CB08 communication protocol V1.0
├── Speech-to-text—text-to-speech/      # Isolated offline ASR/TTS and mobile bridges
├── img/                                # Project images
│   ├── 录音卡片.png                     # Product image
│   ├── 硬件参数.png                     # Hardware specifications
│   └── 微信.png                         # Contact QR code
├── SDK 集成引导.docx                   # SDK integration guide
├── demo.mp4                            # Demonstration video
└── LICENSE                             # MIT License

Run the desktop demo in five minutes

Requirements: Python 3.10 or later, a working BLE adapter, and a recorder card that is ready to connect.

cd pnote-web-win&Mac-demo
python -m venv .venv
source .venv/bin/activate                 # Windows PowerShell: .venv\\Scripts\\Activate.ps1
pip install -r requirements.txt
python main.py --web

Open http://127.0.0.1:8000 in a browser. The web console supports Chinese and English; use the selector in the top-right corner to switch languages. You can also verify the command-line REPL:

record> scan
record> connect 0
record> smoke
record> list
record> download 0
record> transcribe 0

See the desktop demo README for the complete command list. Offline voice is isolated in Speech-to-text—text-to-speech; the Web page remains optional:

cd "../Speech-to-text—text-to-speech"
pip install -r requirements-python.txt
python scripts/fetch_voice_models.py --all
cd "../pnote-web-win&Mac-demo"
pip install -r requirements-web.txt
python -m unittest discover tests -v

Model archives are pinned in Speech-to-text—text-to-speech/models/manifest.json, downloaded from official sherpa-onnx releases, and verified with SHA-256 before extraction. Model weights are intentionally kept out of normal Git history. The existing SDK remains unchanged.

Windows/macOS Web demo

The desktop demo provides both a command-line REPL and a browser-based Web console for device discovery, connection checks, recording control, file downloads, WAV playback, and real-time streaming. Offline ASR/TTS is maintained separately under Speech-to-text—text-to-speech so the existing SDK remains unchanged.

SoniCloud recorder BLE console

Mobile integration

Before integrating, read the SDK integration guide for permissions, dependencies, initialization, callbacks, audio processing, resumable file transfer, and OTA acceptance testing. For the cross-vendor standardization model, see the protocol notes and documents included in this repository.

Flutter

Pure-Dart plugin (recommended) — pnote-flutter-sdk/ implements the full BLE protocol in Dart on top of flutter_blue_plus, with no native SDK dependency. Add it directly from this repository:

pnote_flutter_sdk:
  git:
    url: https://github.com/SonicloudTech/sonicloud_opensdk.git
    path: pnote-flutter-sdk

It covers scan/connect, device info, recording control, the realtime opus stream (recordDataStream), file list/download/delete, and an iOS-parity AppJson compatibility layer. See README.en.md for the full API reference and protocol cmd tables.

Legacy demo (native-SDK based):

cd pnote-sdk-flutter-demo-main
flutter pub get
flutter run

Use a physical device to verify Bluetooth, recording, Wi-Fi, and OTA. The main integration entry point is lib/provider_record_pen.dart; see the Flutter demo README.

Android

Copy the Android AAR to your app's app/libs or src/main/libs directory. Add the fileTree dependency and the SDK's RxJava, Retrofit, EventBus, and other required dependencies, then call:

PNote.init(context, deviceDataListener);
PNote.startSearch();
PNote.connectDevice(name, address);

Callbacks include JSON device events, real-time Opus data, and file Opus data. See the Android SDK guide for the complete API.

iOS

Add libPNote.a and PNode.h to Xcode, implement WindBleDelegate, and call APIs such as startSearch and connectDeviceAndAddress. See the iOS SDK guide for the complete API and OTA workflow.

HarmonyOS

The HarmonyOS SDK is distributed as har_recordersdk.har and currently targets HarmonyOS API 12 or later. Import the HAR package, request Bluetooth permissions, and connect with the deviceId returned by the scan callback. This deviceId may be a system-generated privacy identifier; the address field is for display only. Business results are returned asynchronously through DEVICE_DATA events.

Protocol implementation notes

See the protocol document for field definitions, command tables, captured frames, and compatibility rules.

Integration checklist

  1. Use the desktop demo with a real device to verify discovery, connection, time synchronization, a read-only check, and at least one file download.
  2. Request the required Bluetooth permissions for the target platform. Initialize the SDK, register device-event, real-time-audio, and file-data callbacks, and then start discovery.
  3. Connect with the identifier returned by the scan callback. After connection, synchronize time, then read battery, capacity, firmware version, and the file list.
  4. Convert callbacks into the application's event queue or state-management layer. A method call means that a request was submitted; completion is represented by an asynchronous event.
  5. Send 40-byte Opus frames to a dedicated decoder task. Finalize files on the completion event, record the offset, and validate size and decodability before showing them to users.
  6. Run OTA only after Wi-Fi/TCP is connected, an update is needed, and the battery is at least 20 percent. Mark the upgrade as failed if BLE or Wi-Fi disconnects; do not blindly resend the entire firmware.
  7. When adding a chipset or model, extend VendorAdapter, capability flags, and version negotiation instead of exposing vendor-private fields to application code.
  8. Never hard-code or commit cloud ASR keys, authorization codes, real recordings, or device identifiers. Redact logs and packet captures before sharing them.

Use cases

The project is suitable for meeting recording and note-taking, interviews, classroom training, content creation, inspection records, companion apps for smart hardware, corporate gift and promotional recorders, and other products that need to integrate multiple recorder chipsets into one application.

Hardware adaptation and support

Hardware integration typically follows this sequence: confirm capabilities → implement VendorAdapter → integrate the SDK → validate on real hardware. The hardware team should provide chipset capabilities, BLE services and characteristics, private commands, firmware versions, protocol material, and test scenarios. The adapter maps those differences to the standard interface; the application team then uses Android, iOS, HarmonyOS, or Flutter APIs to build the product workflow.

For hardware specifications, sample devices, the HarmonyOS SDK, complete protocol material, or technical support, contact SoniCloud. Include the target platform, expected volume, device model, firmware version, and intended use case.

SoniCloud contact QR code

Business & technical contact: [email protected]

License and usage boundaries

The example code is released under the MIT License. AAR files, static libraries, HAR packages, firmware, device-private protocols, and some documents may contain SoniCloud or vendor-owned material and are not necessarily open source. Redistribution and commercial use are governed by the accompanying package terms and applicable agreements.

Interfaces, command numbers, and behavior are defined by the current SDK, firmware, protocol version, and real-device validation results. The SDK does not replace application-side Opus decoding, file storage, permission handling, or security controls. Do not use private protocols with hardware or products without authorization.

Feedback and issues

When filing an issue, include the operating system and version, target platform, SDK/demo version, device firmware version, reproduction steps, and relevant logs or TX/RX frame hex. Redact serial numbers, addresses, authorization codes, recordings, and other real-device data before sharing it.

sonicloud_opensdk (SonicloudTech/sonicloud_opensdk)

Searching Database…

What is this?This is an open SDK and reference implementation for connecting a Bluetooth recording-card hardware device (声云录音卡) to your own apps, covering the BLE protocol, device control, real-time audio, file transfer, OTA updates and transcription, with examples for Android, iOS, HarmonyOS, Flutter and Windows/macOS desktop.
Is this a library I integrate, or a finished app?It is mainly an SDK (Android AAR, iOS static lib, HarmonyOS HAR, Flutter plugin) plus a Windows/macOS desktop demo app and a Python reference BLE implementation; you integrate the SDK into your own software to talk to the separate hardware product.
How do I get the desktop demo running?Install Python 3.10+, have a usable BLE adapter and a recording card in connectable range, then run the desktop demo in the 'pnote-web-win&Mac-demo' folder, which offers both a CLI REPL and a browser-based web console.
Do I need the actual recording-card hardware to use this?Yes, you need the physical 声云 recording-card device itself (contact Anhui Sonicloud for samples/specs); for Android integration you also add the AAR plus RxJava, Retrofit and EventBus dependencies.
What does the SDK NOT handle for me?The SDK only hands you raw 16 kHz mono Opus audio frames; it does not decode them or generate WAV headers, and OTA firmware updates always require a Wi-Fi/TCP link since pure BLE cannot transfer firmware.
Which platforms are supported for mobile integration?Android, iOS, HarmonyOS (API 12+) and Flutter are supported for mobile apps, alongside Windows/macOS desktop demos for PC tooling and testing.
What does the VendorAdapter layer actually solve?Different BLE chip vendors like Jieli, Lanxun, Bluetrum and BK each have different service UUIDs, characteristics and private commands; the VendorAdapter layer absorbs these differences so apps use one unified SDK interface regardless of chip.
What can the recording card and SDK actually do together?Button-triggered recording control, real-time Opus audio streaming, resumable file listing and download, Wi-Fi-based file and firmware transfer, device info queries (battery, firmware, SN), and offline speech-to-text after a one-time ~900MB model download.
How is the BLE protocol structured?It uses GATT service 0xAE20 with write characteristic AE21, data-notify AE22 and key-notify AE23, using a MAGIC+SEQ+CRC-16/XMODEM+LEN+TYPE/CMD/PARAMS frame format with reassembly logic for fragmented BLE packets.
When is it safe to trigger an OTA firmware update?Only when the Wi-Fi/TCP link is established, a newer version is actually needed, and the device battery is at least 20%; if BLE or Wi-Fi drops mid-update the task should be marked failed rather than blindly resending the whole firmware.
Size
132.7 MB
Stars
2.6K
Updated
CommitNov 13
Age
3mo
Commits · 90 Days