Skip to content

Conversation

@Surya-sourav
Copy link
Contributor

Integrate Soniox as STT Provider in Glass App

This PR adds support for Soniox as a speech-to-text (STT) provider in the Electron-based Glass app. Users can now select Soniox as their STT provider, validate their API key, and use Soniox for real-time transcription, similar to Whisper.

Summary of Changes

Soniox Provider Integration

  • Implemented SonioxSTTSession in soniox.js with real-time transcription using the Soniox API.
  • Added a close() method to match the expected STT session interface.
  • Registered Soniox in the PROVIDERS object in factory.js with its model.

API Key Validation

  • Updated modelStateService.js to handle Soniox in validateApiKey, including format validation and proper state updates.
  • Ensured Soniox API key is saved and the provider/model is auto-selected after validation.

IPC & State Management

  • Removed duplicate model:validate-key IPC handler from windowManager.js to avoid Electron handler conflicts.
  • Ensured only modelStateService.js manages API key validation and state.

Related Issue

Contributor's Self-Review Checklist

Please check the boxes that apply. This is a reminder of what we look for in a good pull request.

  • I have read the CONTRIBUTING.md document.
  • My code follows the project's coding style and architectural patterns as described in DESIGN_PATTERNS.md.
  • I have added or updated relevant tests for my changes.
  • I have updated the documentation to reflect my changes (if applicable).
  • My changes have been tested locally and are working as expected.

Additional Context (Optional)

  • Manually tested Soniox selection and API key validation in the UI.
  • Verified Soniox is selectable and persists as the current STT provider.
  • Confirmed real-time transcription works with Soniox.
  • Ensured no "Unknown provider" or IPC handler errors occur.
  • Validated that the listen service starts and stops Soniox sessions without errors.

** Logs :**
[ModelStateService] Selected STT model from newly configured provider soniox: en_v2
[ModelStateService] State saved for user: default_user
[ModelStateService] Current Selection -> LLM: claude-3-5-sonnet-20241022 (Provider: anthropic), STT: en_v2 (Provider: soniox)
[ModelStateService] Current Selection -> LLM: claude-3-5-sonnet-20241022 (Provider: anthropic), STT: en_v2 (Provider: soniox)
[ModelStateService] API key for soniox is valid.

image

@samtiz @entry-sanio @jhyang0 @ekim425 Please Review the PR & give me feedback.
I would also review the PR once again from my end.

Copy link
Contributor Author

@Surya-sourav Surya-sourav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soniox Provider Integration

  • Implemented SonioxSTTSession in soniox.js with real-time transcription using the Soniox API.
  • Added a close() method to match the expected STT session interface.
  • Registered Soniox in the PROVIDERS object in factory.js with its model.
  • API Key Validation
  • Updated modelStateService.js to handle Soniox in validateApiKey, including format validation and proper state updates.
  • Ensured Soniox API key is saved and the provider/model is auto-selected after validation.

IPC & State Management

  • Removed duplicate model:validate-key IPC handler from windowManager.js to avoid Electron handler conflicts.
  • Ensured only modelStateService.js manages API key validation and state.

UI/UX

  • Soniox now appears as a selectable STT provider in the configuration UI.
  • Fixed "Unknown provider" error for Soniox in the UI.

@samtiz
Copy link
Contributor

samtiz commented Jul 11, 2025

Hi @Surya-sourav
Thanks for contribution! I've tested this in my local mac: get API key from Soniox console, set it in glass, select stt model. but transcribing doesn't work on my end. Is there anything wrong with my workflow?

@Surya-sourav
Copy link
Contributor Author

@samtiz Let me check it once again and reconfirm. Thanks for testing !

@Surya-sourav
Copy link
Contributor Author

@samtiz Actually i got the issue , Soniox expects the audio in a WAV format but Glass app is likely sending Raw PCM , so let me just fix this asap and re pull the PR

@Surya-sourav
Copy link
Contributor Author

@samtiz You can test it now , I hope it wont be an issue after the fix. Thanks :)

@Surya-sourav
Copy link
Contributor Author

@samtiz @entry-sanio @jhyang0 @ekim425 Merge Conflicts are resolved , its ready to get Merged !

@Surya-sourav
Copy link
Contributor Author

@samtiz @entry-sanio @ekim425 Please confirm about this PR !

@MyButtermilk
Copy link

@samtiz @entry-sanio Any updates on this PR from your side?

@Surya-sourav
Copy link
Contributor Author

@samtiz @entry-sanio Guys , this PR is getting old and currently is 14 commits behind the latest Upstream.

What are your suggestions ? Ik u must be busy with other important features & bug fixes but your decision would help here.

@MyButtermilk
Copy link

@samtiz @entry-sanio : I know you are busy! I really implore you though to have a look at this PR - it would be quite a big jump in quality for Glass : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please support Soniox

3 participants