speechControl Driver

Last updated: · On hold
From the first request to the first voice
M3A4 successfully delivered the first speech request, received its acknowledgement and recovered cleanly. The sentence and settings were recovered intact from the Pi-side diagnostic. A separate test then generated a speech WAV and played it through the Next’s DAC. The next milestone, M3B, brings this proven synthesis and playback route into the driver itself.
The M2E communications baseline remains 41 frames / 0.82 seconds for a cold start and 21 frames / 0.42 seconds for a warm reconnect.
Milestone 2 is hardware-proven
The resident driver and NextPi communications foundation now work on real ZX Spectrum Next hardware through M2E. The persistent nextpi-speech_service is running successfully, SCSP HELLO and PING are proven, and warm reconnect works. The first TTS request is now proven too. Synthesis and DAC playback have succeeded in a separate test; integration and speech recognition remain development work.
Overview
speechControl is a ZX Spectrum Next / NextZXOS driver designed to bring text-to-speech (TTS) and speech-to-text (STT) to NextBASIC games without turning the Z80 into a speech processor.
The design deliberately divides the work between the two processors already available in a NextPi-equipped machine. The Spectrum Next remains in charge of the game: movement, sprites, scrolling, collision, music, effects and game logic. The Raspberry Pi Zero acts as a dedicated speech coprocessor, handling the expensive work of speech synthesis, microphone capture and recognition.
That division is important because the goal is not simply to demonstrate that the machine can talk. speechControl is intended to behave like a proper game-development service: the game submits work, carries on running, and later checks status or receives a compact result.
The game-facing interface is deliberately kept independent of Linux, ALSA, USB audio devices and individual TTS/STT engines. A NextBASIC program should not need to know which speech engine is installed on the Pi or how the microphone is configured.
PRINT #speech;"Enemy vessel approaching."This is the intended game-facing syntax; the next step is to connect the proven command round trip to the separately proven synthesis and playback route.
For speech recognition, a game will be able to define small command grammars such as LEFT, RIGHT, FIRE or RAISE SHIELDS. The Pi performs the recognition and returns a compact command ID and confidence value rather than streaming speech-quality audio through the Z80.
Core architectural rule The Spectrum controls speech. The Pi performs speech processing. This keeps the game responsive and hides backend-specific details behind a stable driver interface. |
Under the hood, speechControl uses genuine NextZXOS driver facilities. Numeric control and status are exposed through DRIVER calls, while variable-length text is handled through logical driver channels. The resident driver stays small, and the larger worker code and buffers live in one additional 8K Spectrum RAM bank that is temporarily mapped through MMU7 and then restored exactly before returning to the caller.