# supertone-oss-archive/supertonic architecture

> Architecture diagram of the GitHub repository supertone-oss-archive/supertonic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/supertone-oss-archive/supertonic
- Repository: https://github.com/supertone-oss-archive/supertonic

## Overview

Supertonic is an archived, local ONNX text-to-speech project, distributed here as runnable examples for multiple languages and platforms. The user supplies text, language, and a voice style; the example loads model resources, performs inference, and produces playable or writable audio. The graph preserves the documented runtime breadth and the sampled web and iOS workflows. Several runtime implementations are represented by their source files, but their internal calls were not sampled, so unsupported connections are omitted.

Main entry points: [`web/main.js`](https://github.com/supertone-oss-archive/supertonic/blob/main/web/main.js) (Browser interface), [`ios/ExampleiOSApp/TTSViewModel.swift`](https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/TTSViewModel.swift) (iOS view model), [`ios/ExampleiOSApp/ContentView.swift`](https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/ContentView.swift) (iOS interface), [`py/example_onnx.py`](https://github.com/supertone-oss-archive/supertonic/blob/main/py/example_onnx.py) (Python ONNX example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser TTS"]
  node_web_ui["Browser interface<br/>[main.js]"]
  node_web_tts["Browser TTS helpers<br/>[helper.js]"]
end

subgraph group_mobile["Mobile TTS"]
  node_ios_view["iOS interface<br/>[ContentView.swift]"]
  node_ios_vm["iOS view model<br/>[TTSViewModel.swift]"]
  node_ios_service["iOS TTS service<br/>[TTSService.swift]"]
  node_ios_audio["iOS audio player<br/>[AudioPlayer.swift]"]
  node_flutter_app["Flutter example<br/>[main.dart]"]
  node_flutter_helper["Flutter TTS helper<br/>[helper.dart]"]
end

subgraph group_native["Native SDK examples"]
  node_python_example["Python ONNX example<br/>[example_onnx.py]"]
  node_python_tts["Python TTS helpers<br/>[helper.py]"]
  node_python_package["Python package example<br/>[example_pypi.py]"]
  node_node_example["Node.js example<br/>[example_onnx.js]"]
  node_node_tts["Node.js TTS helpers<br/>[helper.js]"]
  node_java_example["Java example<br/>[ExampleONNX.java]"]
  node_java_tts["Java TTS helpers<br/>[Helper.java]"]
  node_cpp_example["C++ example<br/>[example_onnx.cpp]"]
  node_cpp_tts["C++ TTS helpers<br/>[helper.cpp]"]
  node_csharp_example["C&#35; example<br/>[ExampleONNX.cs]"]
  node_csharp_tts["C&#35; TTS helpers<br/>[Helper.cs]"]
  node_go_example["Go example<br/>[example_onnx.go]"]
  node_go_tts["Go TTS helpers<br/>[helper.go]"]
  node_rust_example["Rust example<br/>[example_onnx.rs]"]
  node_rust_tts["Rust TTS helpers<br/>[helper.rs]"]
  node_swift_example["Swift example<br/>[ExampleONNX.swift]"]
  node_swift_tts["Swift TTS helpers<br/>[Helper.swift]"]
end

subgraph group_inference["TTS inference"]
  node_onnx_models["ONNX model assets"]
  node_generated_audio["Generated WAV audio"]
end

node_user(("Text-to-speech user"))

node_user -->|"enters text"| node_web_ui
node_web_ui -->|"loads and synthesizes"| node_web_tts
node_web_ui -->|"creates WAV"| node_generated_audio
node_user -.->|"enters text"| node_ios_view
node_ios_view -->|"delegates actions"| node_ios_vm
node_ios_vm -->|"requests synthesis"| node_ios_service
node_ios_vm -->|"controls playback"| node_ios_audio
node_python_example -->|"imports"| node_python_tts
node_node_example -->|"imports"| node_node_tts
node_java_example -->|"imports"| node_java_tts
node_cpp_example -->|"includes"| node_cpp_tts
node_csharp_example -->|"uses"| node_csharp_tts

click node_web_ui "https://github.com/supertone-oss-archive/supertonic/blob/main/web/main.js"
click node_web_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/web/helper.js"
click node_ios_view "https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/ContentView.swift"
click node_ios_vm "https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/TTSViewModel.swift"
click node_ios_service "https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/TTSService.swift"
click node_ios_audio "https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/AudioPlayer.swift"
click node_flutter_app "https://github.com/supertone-oss-archive/supertonic/blob/main/flutter/lib/main.dart"
click node_flutter_helper "https://github.com/supertone-oss-archive/supertonic/blob/main/flutter/lib/helper.dart"
click node_python_example "https://github.com/supertone-oss-archive/supertonic/blob/main/py/example_onnx.py"
click node_python_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/py/helper.py"
click node_python_package "https://github.com/supertone-oss-archive/supertonic/blob/main/py/example_pypi.py"
click node_node_example "https://github.com/supertone-oss-archive/supertonic/blob/main/nodejs/example_onnx.js"
click node_node_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/nodejs/helper.js"
click node_java_example "https://github.com/supertone-oss-archive/supertonic/blob/main/java/ExampleONNX.java"
click node_java_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/java/Helper.java"
click node_cpp_example "https://github.com/supertone-oss-archive/supertonic/blob/main/cpp/example_onnx.cpp"
click node_cpp_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/cpp/helper.cpp"
click node_csharp_example "https://github.com/supertone-oss-archive/supertonic/blob/main/csharp/ExampleONNX.cs"
click node_csharp_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/csharp/Helper.cs"
click node_go_example "https://github.com/supertone-oss-archive/supertonic/blob/main/go/example_onnx.go"
click node_go_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/go/helper.go"
click node_rust_example "https://github.com/supertone-oss-archive/supertonic/blob/main/rust/src/example_onnx.rs"
click node_rust_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/rust/src/helper.rs"
click node_swift_example "https://github.com/supertone-oss-archive/supertonic/blob/main/swift/Sources/ExampleONNX.swift"
click node_swift_tts "https://github.com/supertone-oss-archive/supertonic/blob/main/swift/Sources/Helper.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_ui,node_web_tts,node_user toneBlue
class node_ios_view,node_ios_vm,node_ios_service,node_ios_audio,node_flutter_app,node_flutter_helper toneAmber
class node_python_example,node_python_tts,node_python_package,node_node_example,node_node_tts,node_java_example,node_java_tts,node_cpp_example,node_cpp_tts,node_csharp_example,node_csharp_tts,node_go_example,node_go_tts,node_rust_example,node_rust_tts,node_swift_example,node_swift_tts toneMint
class node_onnx_models,node_generated_audio toneRose
```

## Components

### Browser TTS

- [Browser interface](https://github.com/supertone-oss-archive/supertonic/blob/main/web/main.js): `web/main.js`
- [Browser TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/web/helper.js): `web/helper.js`

### Mobile TTS

- [iOS interface](https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/ContentView.swift): `ios/ExampleiOSApp/ContentView.swift`
- [iOS view model](https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/TTSViewModel.swift): `ios/ExampleiOSApp/TTSViewModel.swift`
- [iOS TTS service](https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/TTSService.swift): `ios/ExampleiOSApp/TTSService.swift`
- [iOS audio player](https://github.com/supertone-oss-archive/supertonic/blob/main/ios/ExampleiOSApp/AudioPlayer.swift): `ios/ExampleiOSApp/AudioPlayer.swift`
- [Flutter example](https://github.com/supertone-oss-archive/supertonic/blob/main/flutter/lib/main.dart): `flutter/lib/main.dart`
- [Flutter TTS helper](https://github.com/supertone-oss-archive/supertonic/blob/main/flutter/lib/helper.dart): `flutter/lib/helper.dart`

### Native SDK examples

- [Python ONNX example](https://github.com/supertone-oss-archive/supertonic/blob/main/py/example_onnx.py): `py/example_onnx.py`
- [Python TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/py/helper.py): `py/helper.py`
- [Python package example](https://github.com/supertone-oss-archive/supertonic/blob/main/py/example_pypi.py): `py/example_pypi.py`
- [Node.js example](https://github.com/supertone-oss-archive/supertonic/blob/main/nodejs/example_onnx.js): `nodejs/example_onnx.js`
- [Node.js TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/nodejs/helper.js): `nodejs/helper.js`
- [Java example](https://github.com/supertone-oss-archive/supertonic/blob/main/java/ExampleONNX.java): `java/ExampleONNX.java`
- [Java TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/java/Helper.java): `java/Helper.java`
- [C++ example](https://github.com/supertone-oss-archive/supertonic/blob/main/cpp/example_onnx.cpp): `cpp/example_onnx.cpp`
- [C++ TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/cpp/helper.cpp): `cpp/helper.cpp`
- [C# example](https://github.com/supertone-oss-archive/supertonic/blob/main/csharp/ExampleONNX.cs): `csharp/ExampleONNX.cs`
- [C# TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/csharp/Helper.cs): `csharp/Helper.cs`
- [Go example](https://github.com/supertone-oss-archive/supertonic/blob/main/go/example_onnx.go): `go/example_onnx.go`
- [Go TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/go/helper.go): `go/helper.go`
- [Rust example](https://github.com/supertone-oss-archive/supertonic/blob/main/rust/src/example_onnx.rs): `rust/src/example_onnx.rs`
- [Rust TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/rust/src/helper.rs): `rust/src/helper.rs`
- [Swift example](https://github.com/supertone-oss-archive/supertonic/blob/main/swift/Sources/ExampleONNX.swift): `swift/Sources/ExampleONNX.swift`
- [Swift TTS helpers](https://github.com/supertone-oss-archive/supertonic/blob/main/swift/Sources/Helper.swift): `swift/Sources/Helper.swift`

### TTS inference

- **ONNX model assets**
- **Generated WAV audio**

### Other components

- **Text-to-speech user**

## Connections

- Text-to-speech user → Browser interface: enters text (evidence: `README.md`)
- Browser interface → Browser TTS helpers: loads and synthesizes (evidence: `web/main.js`)
- Browser interface → Generated WAV audio: creates WAV (evidence: `web/main.js`)
- Text-to-speech user → iOS interface: enters text
- iOS interface → iOS view model: delegates actions (evidence: `ios/ExampleiOSApp/ContentView.swift`)
- iOS view model → iOS TTS service: requests synthesis (evidence: `ios/ExampleiOSApp/TTSViewModel.swift`)
- iOS view model → iOS audio player: controls playback (evidence: `ios/ExampleiOSApp/TTSViewModel.swift`)
- Python ONNX example → Python TTS helpers: imports (evidence: `py/example_onnx.py`)
- Node.js example → Node.js TTS helpers: imports (evidence: `nodejs/example_onnx.js`)
- Java example → Java TTS helpers: imports (evidence: `java/ExampleONNX.java`)
- C++ example → C++ TTS helpers: includes (evidence: `cpp/example_onnx.cpp`)
- C# example → C# TTS helpers: uses (evidence: `csharp/ExampleONNX.cs`)
