openspeechapi 0.6.0__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/.gitignore +8 -0
  2. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/PKG-INFO +111 -18
  3. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/README.md +42 -5
  4. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/__init__.py +47 -4
  5. openspeechapi-0.7.0/openspeechapi/audio_toolkit/__init__.py +9 -0
  6. openspeechapi-0.7.0/openspeechapi/audio_toolkit/runner.py +110 -0
  7. openspeechapi-0.7.0/openspeechapi/audio_toolkit/worker.py +49 -0
  8. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/cli.py +40 -4
  9. openspeechapi-0.7.0/openspeechapi/client/client.py +914 -0
  10. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/config.py +273 -0
  11. openspeechapi-0.7.0/openspeechapi/core/artifacts.py +74 -0
  12. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/base.py +316 -2
  13. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/enums.py +34 -0
  14. openspeechapi-0.7.0/openspeechapi/core/events.py +74 -0
  15. openspeechapi-0.7.0/openspeechapi/core/features.py +99 -0
  16. openspeechapi-0.7.0/openspeechapi/core/jobs.py +363 -0
  17. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/model_hub.py +60 -3
  18. openspeechapi-0.7.0/openspeechapi/core/model_manifests.py +129 -0
  19. openspeechapi-0.7.0/openspeechapi/core/model_policy.py +18 -0
  20. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/models.py +178 -0
  21. openspeechapi-0.7.0/openspeechapi/core/realtime.py +491 -0
  22. openspeechapi-0.7.0/openspeechapi/core/runtime_probe.py +205 -0
  23. openspeechapi-0.7.0/openspeechapi/core/stream_sessions.py +391 -0
  24. openspeechapi-0.7.0/openspeechapi/core/transcript_events.py +122 -0
  25. openspeechapi-0.7.0/openspeechapi/core/tts_quality.py +90 -0
  26. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/aim_provision.py +20 -3
  27. openspeechapi-0.7.0/openspeechapi/dispatch/analysis_pipeline.py +1233 -0
  28. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/dispatcher.py +735 -95
  29. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/executors/subprocess_exec.py +40 -9
  30. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/lifecycle.py +106 -21
  31. openspeechapi-0.7.0/openspeechapi/dispatch/long_recording.py +255 -0
  32. openspeechapi-0.7.0/openspeechapi/dispatch/long_recording_audio.py +137 -0
  33. openspeechapi-0.7.0/openspeechapi/dispatch/long_recording_gate.py +26 -0
  34. openspeechapi-0.7.0/openspeechapi/dispatch/long_recording_vad.py +94 -0
  35. openspeechapi-0.7.0/openspeechapi/dispatch/speaker_attribution.py +149 -0
  36. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/engine_catalog.py +111 -5
  37. openspeechapi-0.7.0/openspeechapi/engine_registry.yaml +3905 -0
  38. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/exceptions.py +11 -0
  39. openspeechapi-0.7.0/openspeechapi/factory.py +1076 -0
  40. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/aim_resolver.py +297 -9
  41. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/backends/docker_backend.py +11 -2
  42. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/backends/native_backend.py +156 -18
  43. openspeechapi-0.7.0/openspeechapi/local_engines/coqui_model_installer.py +23 -0
  44. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/cosyvoice_venv.py +8 -3
  45. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/engines/fish_speech.py +4 -1
  46. openspeechapi-0.7.0/openspeechapi/local_engines/engines/mlx_audio.py +33 -0
  47. openspeechapi-0.7.0/openspeechapi/local_engines/engines/moshi.py +49 -0
  48. openspeechapi-0.7.0/openspeechapi/local_engines/engines/openmoss.py +45 -0
  49. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/engines/sherpa_onnx.py +7 -2
  50. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/engines/whisperlivekit.py +6 -3
  51. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/fish_venv.py +51 -5
  52. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/manager.py +57 -3
  53. openspeechapi-0.7.0/openspeechapi/local_engines/mlx_audio_probe.py +203 -0
  54. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/models.py +1 -1
  55. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/registry.py +6 -0
  56. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/task_store.py +4 -1
  57. openspeechapi-0.7.0/openspeechapi/model_manifests.yaml +895 -0
  58. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/observe/debug.py +1 -1
  59. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/observe/tracing.py +1 -1
  60. openspeechapi-0.7.0/openspeechapi/providers/alibaba_common.py +118 -0
  61. openspeechapi-0.7.0/openspeechapi/providers/alibaba_contracts.py +235 -0
  62. openspeechapi-0.7.0/openspeechapi/providers/analysis/__init__.py +1 -0
  63. openspeechapi-0.7.0/openspeechapi/providers/analysis/alibaba_tingwu.py +546 -0
  64. openspeechapi-0.7.0/openspeechapi/providers/analysis/azure_content_understanding.py +311 -0
  65. openspeechapi-0.7.0/openspeechapi/providers/analysis/cartesia_voice.py +239 -0
  66. openspeechapi-0.7.0/openspeechapi/providers/analysis/clearer_voice.py +122 -0
  67. openspeechapi-0.7.0/openspeechapi/providers/analysis/deepgram.py +452 -0
  68. openspeechapi-0.7.0/openspeechapi/providers/analysis/doubao_minutes.py +389 -0
  69. openspeechapi-0.7.0/openspeechapi/providers/analysis/doubao_voice.py +194 -0
  70. openspeechapi-0.7.0/openspeechapi/providers/analysis/elevenlabs.py +468 -0
  71. openspeechapi-0.7.0/openspeechapi/providers/analysis/gemini.py +155 -0
  72. openspeechapi-0.7.0/openspeechapi/providers/analysis/iflytek_voice_clone.py +386 -0
  73. openspeechapi-0.7.0/openspeechapi/providers/analysis/minimax_voice.py +225 -0
  74. openspeechapi-0.7.0/openspeechapi/providers/analysis/mistral.py +173 -0
  75. openspeechapi-0.7.0/openspeechapi/providers/analysis/mistral_voice.py +155 -0
  76. openspeechapi-0.7.0/openspeechapi/providers/analysis/mlx_audio.py +998 -0
  77. openspeechapi-0.7.0/openspeechapi/providers/analysis/nemotron_diarization.py +627 -0
  78. openspeechapi-0.7.0/openspeechapi/providers/analysis/openai_compatible.py +325 -0
  79. openspeechapi-0.7.0/openspeechapi/providers/analysis/pyannote_diarization.py +212 -0
  80. openspeechapi-0.7.0/openspeechapi/providers/analysis/qwen.py +189 -0
  81. openspeechapi-0.7.0/openspeechapi/providers/analysis/qwen_voice.py +221 -0
  82. openspeechapi-0.7.0/openspeechapi/providers/analysis/silero_vad.py +423 -0
  83. openspeechapi-0.7.0/openspeechapi/providers/analysis/smart_turn.py +232 -0
  84. openspeechapi-0.7.0/openspeechapi/providers/analysis/smart_turn_features.py +88 -0
  85. openspeechapi-0.7.0/openspeechapi/providers/analysis/soniox_voice.py +165 -0
  86. openspeechapi-0.7.0/openspeechapi/providers/assemblyai_contracts.py +375 -0
  87. openspeechapi-0.7.0/openspeechapi/providers/aws_common.py +39 -0
  88. openspeechapi-0.7.0/openspeechapi/providers/aws_contracts.py +221 -0
  89. openspeechapi-0.7.0/openspeechapi/providers/azure_common.py +69 -0
  90. openspeechapi-0.7.0/openspeechapi/providers/azure_contracts.py +122 -0
  91. openspeechapi-0.7.0/openspeechapi/providers/baidu_common.py +100 -0
  92. openspeechapi-0.7.0/openspeechapi/providers/baidu_contracts.py +218 -0
  93. openspeechapi-0.7.0/openspeechapi/providers/cartesia_common.py +28 -0
  94. openspeechapi-0.7.0/openspeechapi/providers/cartesia_contracts.py +191 -0
  95. openspeechapi-0.7.0/openspeechapi/providers/deepgram_common.py +170 -0
  96. openspeechapi-0.7.0/openspeechapi/providers/deepgram_contracts.py +357 -0
  97. openspeechapi-0.7.0/openspeechapi/providers/elevenlabs_contracts.py +258 -0
  98. openspeechapi-0.7.0/openspeechapi/providers/gemini_common.py +110 -0
  99. openspeechapi-0.7.0/openspeechapi/providers/gemini_contracts.py +108 -0
  100. openspeechapi-0.7.0/openspeechapi/providers/generation/__init__.py +1 -0
  101. openspeechapi-0.7.0/openspeechapi/providers/generation/doubao.py +232 -0
  102. openspeechapi-0.7.0/openspeechapi/providers/generation/elevenlabs.py +177 -0
  103. openspeechapi-0.7.0/openspeechapi/providers/generation/minimax.py +223 -0
  104. openspeechapi-0.7.0/openspeechapi/providers/generation/openmoss.py +262 -0
  105. openspeechapi-0.7.0/openspeechapi/providers/iflytek_common.py +102 -0
  106. openspeechapi-0.7.0/openspeechapi/providers/iflytek_contracts.py +357 -0
  107. openspeechapi-0.7.0/openspeechapi/providers/iflytek_voiceprint.py +205 -0
  108. openspeechapi-0.7.0/openspeechapi/providers/local_contracts.py +1307 -0
  109. openspeechapi-0.7.0/openspeechapi/providers/minimax_common.py +99 -0
  110. openspeechapi-0.7.0/openspeechapi/providers/minimax_contracts.py +161 -0
  111. openspeechapi-0.7.0/openspeechapi/providers/mistral_common.py +53 -0
  112. openspeechapi-0.7.0/openspeechapi/providers/mistral_contracts.py +230 -0
  113. openspeechapi-0.7.0/openspeechapi/providers/mlx_audio_common.py +120 -0
  114. openspeechapi-0.7.0/openspeechapi/providers/openai_contracts.py +215 -0
  115. openspeechapi-0.7.0/openspeechapi/providers/realtime/assemblyai_agent.py +328 -0
  116. openspeechapi-0.7.0/openspeechapi/providers/realtime/azure_voice_live.py +111 -0
  117. openspeechapi-0.7.0/openspeechapi/providers/realtime/deepgram_agent.py +363 -0
  118. openspeechapi-0.7.0/openspeechapi/providers/realtime/doubao_realtime.py +246 -0
  119. openspeechapi-0.7.0/openspeechapi/providers/realtime/elevenlabs_agent.py +324 -0
  120. openspeechapi-0.7.0/openspeechapi/providers/realtime/gemini_live.py +374 -0
  121. openspeechapi-0.7.0/openspeechapi/providers/realtime/moshi_realtime.py +80 -0
  122. openspeechapi-0.7.0/openspeechapi/providers/realtime/openai_realtime.py +170 -0
  123. openspeechapi-0.7.0/openspeechapi/providers/realtime/openai_translation.py +147 -0
  124. openspeechapi-0.7.0/openspeechapi/providers/realtime/qwen_live_translate.py +199 -0
  125. openspeechapi-0.7.0/openspeechapi/providers/realtime/qwen_omni_realtime.py +291 -0
  126. openspeechapi-0.7.0/openspeechapi/providers/realtime/tencent_translation.py +196 -0
  127. openspeechapi-0.7.0/openspeechapi/providers/soniox_contracts.py +394 -0
  128. openspeechapi-0.7.0/openspeechapi/providers/speechmatics_contracts.py +92 -0
  129. openspeechapi-0.7.0/openspeechapi/providers/stt/alibaba.py +716 -0
  130. openspeechapi-0.7.0/openspeechapi/providers/stt/assemblyai.py +798 -0
  131. openspeechapi-0.7.0/openspeechapi/providers/stt/assemblyai_short_form.py +333 -0
  132. openspeechapi-0.7.0/openspeechapi/providers/stt/assemblyai_streaming.py +460 -0
  133. openspeechapi-0.7.0/openspeechapi/providers/stt/aws_transcribe.py +491 -0
  134. openspeechapi-0.7.0/openspeechapi/providers/stt/azure_speech.py +293 -0
  135. openspeechapi-0.7.0/openspeechapi/providers/stt/baidu.py +621 -0
  136. openspeechapi-0.7.0/openspeechapi/providers/stt/cartesia.py +338 -0
  137. openspeechapi-0.7.0/openspeechapi/providers/stt/deepgram.py +695 -0
  138. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/dolphin_stt.py +130 -7
  139. openspeechapi-0.7.0/openspeechapi/providers/stt/doubao.py +389 -0
  140. openspeechapi-0.7.0/openspeechapi/providers/stt/elevenlabs.py +740 -0
  141. openspeechapi-0.7.0/openspeechapi/providers/stt/faster_whisper.py +490 -0
  142. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/fireredasr_stt.py +140 -9
  143. openspeechapi-0.7.0/openspeechapi/providers/stt/funasr_stt.py +528 -0
  144. openspeechapi-0.7.0/openspeechapi/providers/stt/gemini.py +130 -0
  145. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/gemma4.py +67 -7
  146. openspeechapi-0.7.0/openspeechapi/providers/stt/google_cloud.py +292 -0
  147. openspeechapi-0.7.0/openspeechapi/providers/stt/iflytek.py +1308 -0
  148. openspeechapi-0.7.0/openspeechapi/providers/stt/iflytek_framed.py +953 -0
  149. openspeechapi-0.7.0/openspeechapi/providers/stt/iflytek_recording.py +890 -0
  150. openspeechapi-0.7.0/openspeechapi/providers/stt/iflytek_rtasr.py +655 -0
  151. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/macos_speech.py +294 -231
  152. openspeechapi-0.7.0/openspeechapi/providers/stt/minimax.py +249 -0
  153. openspeechapi-0.7.0/openspeechapi/providers/stt/mistral.py +409 -0
  154. openspeechapi-0.7.0/openspeechapi/providers/stt/mlx_audio.py +893 -0
  155. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/mlx_whisper_stt.py +121 -17
  156. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/moonshine_stt.py +47 -4
  157. openspeechapi-0.7.0/openspeechapi/providers/stt/openai.py +605 -0
  158. openspeechapi-0.7.0/openspeechapi/providers/stt/paraformer.py +540 -0
  159. openspeechapi-0.7.0/openspeechapi/providers/stt/parakeet_mlx_stt.py +345 -0
  160. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/qwen3_asr.py +139 -6
  161. openspeechapi-0.7.0/openspeechapi/providers/stt/sensevoice.py +499 -0
  162. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/sherpa_onnx.py +404 -30
  163. openspeechapi-0.7.0/openspeechapi/providers/stt/soniox.py +792 -0
  164. openspeechapi-0.7.0/openspeechapi/providers/stt/speechmatics.py +441 -0
  165. openspeechapi-0.7.0/openspeechapi/providers/stt/tencent.py +723 -0
  166. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/volcengine.py +2 -2
  167. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/vosk_stt.py +173 -16
  168. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/wenet_stt.py +83 -12
  169. openspeechapi-0.7.0/openspeechapi/providers/stt/whisper.py +502 -0
  170. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/whisperlivekit.py +250 -49
  171. openspeechapi-0.7.0/openspeechapi/providers/tencent_common.py +166 -0
  172. openspeechapi-0.7.0/openspeechapi/providers/tencent_contracts.py +126 -0
  173. openspeechapi-0.7.0/openspeechapi/providers/translation/__init__.py +1 -0
  174. openspeechapi-0.7.0/openspeechapi/providers/translation/doubao.py +186 -0
  175. openspeechapi-0.7.0/openspeechapi/providers/translation/gemini.py +146 -0
  176. openspeechapi-0.7.0/openspeechapi/providers/translation/nllb.py +309 -0
  177. openspeechapi-0.7.0/openspeechapi/providers/translation/openai_compatible.py +310 -0
  178. openspeechapi-0.7.0/openspeechapi/providers/translation/qwen.py +170 -0
  179. openspeechapi-0.7.0/openspeechapi/providers/tts/alibaba.py +514 -0
  180. openspeechapi-0.7.0/openspeechapi/providers/tts/aws_polly.py +179 -0
  181. openspeechapi-0.7.0/openspeechapi/providers/tts/azure_speech.py +214 -0
  182. openspeechapi-0.7.0/openspeechapi/providers/tts/baidu.py +508 -0
  183. openspeechapi-0.7.0/openspeechapi/providers/tts/cartesia.py +241 -0
  184. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/chatterbox.py +115 -10
  185. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/coqui.py +135 -13
  186. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/cosyvoice.py +379 -40
  187. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/cosyvoice3.py +108 -32
  188. openspeechapi-0.7.0/openspeechapi/providers/tts/deepgram.py +519 -0
  189. openspeechapi-0.7.0/openspeechapi/providers/tts/doubao.py +316 -0
  190. openspeechapi-0.7.0/openspeechapi/providers/tts/elevenlabs.py +647 -0
  191. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/f5_tts.py +13 -4
  192. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/fish_speech.py +136 -11
  193. openspeechapi-0.7.0/openspeechapi/providers/tts/gemini.py +111 -0
  194. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/google_cloud.py +37 -12
  195. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/iflytek.py +130 -97
  196. openspeechapi-0.7.0/openspeechapi/providers/tts/iflytek_long.py +417 -0
  197. openspeechapi-0.7.0/openspeechapi/providers/tts/iflytek_streaming.py +712 -0
  198. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/indextts.py +30 -3
  199. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/kokoro.py +10 -4
  200. openspeechapi-0.7.0/openspeechapi/providers/tts/minimax.py +415 -0
  201. openspeechapi-0.7.0/openspeechapi/providers/tts/minimax_long.py +127 -0
  202. openspeechapi-0.7.0/openspeechapi/providers/tts/mistral.py +238 -0
  203. openspeechapi-0.7.0/openspeechapi/providers/tts/mlx_audio.py +750 -0
  204. openspeechapi-0.7.0/openspeechapi/providers/tts/openai.py +257 -0
  205. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/piper.py +2 -0
  206. openspeechapi-0.7.0/openspeechapi/providers/tts/soniox.py +307 -0
  207. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/spark.py +7 -1
  208. openspeechapi-0.7.0/openspeechapi/providers/tts/tencent.py +508 -0
  209. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/volcengine.py +1 -1
  210. openspeechapi-0.7.0/openspeechapi/providers/tts/voxcpm.py +263 -0
  211. openspeechapi-0.7.0/openspeechapi/providers/volcengine_contracts.py +218 -0
  212. openspeechapi-0.7.0/openspeechapi/providers/volcengine_protocol.py +191 -0
  213. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/runtime_environment.py +12 -2
  214. openspeechapi-0.7.0/openspeechapi/server/analysis_job_runner.py +468 -0
  215. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/app.py +103 -3
  216. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/model_downloads.py +263 -11
  217. openspeechapi-0.7.0/openspeechapi/server/routes/analysis_jobs.py +434 -0
  218. openspeechapi-0.7.0/openspeechapi/server/routes/analysis_sessions.py +60 -0
  219. openspeechapi-0.7.0/openspeechapi/server/routes/audio.py +88 -0
  220. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/config.py +279 -42
  221. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/engine_catalog.py +137 -5
  222. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/engine_services.py +5 -5
  223. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/engines.py +144 -9
  224. openspeechapi-0.7.0/openspeechapi/server/routes/iflytek_voiceprint.py +275 -0
  225. openspeechapi-0.7.0/openspeechapi/server/routes/local_voiceprint.py +284 -0
  226. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/models.py +36 -3
  227. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/stt.py +188 -3
  228. openspeechapi-0.7.0/openspeechapi/server/routes/translation.py +107 -0
  229. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/tts.py +195 -22
  230. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/services/config_io.py +1 -0
  231. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/services/model_provision.py +28 -14
  232. openspeechapi-0.7.0/openspeechapi/server/stt_job_runner.py +206 -0
  233. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/system_metrics.py +12 -4
  234. openspeechapi-0.7.0/openspeechapi/server/tts_job_runner.py +219 -0
  235. openspeechapi-0.7.0/openspeechapi/server/webui/app.js +10459 -0
  236. openspeechapi-0.7.0/openspeechapi/server/webui/index.html +753 -0
  237. openspeechapi-0.7.0/openspeechapi/server/webui/styles.css +1713 -0
  238. openspeechapi-0.7.0/openspeechapi/server/ws/analysis_stream.py +563 -0
  239. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/ws/realtime_stream.py +95 -32
  240. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/ws/stt_stream.py +151 -37
  241. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/ws/tts_stream.py +278 -31
  242. openspeechapi-0.7.0/openspeechapi/state/__init__.py +5 -0
  243. openspeechapi-0.7.0/openspeechapi/state/local_voiceprints.py +65 -0
  244. openspeechapi-0.7.0/openspeechapi/state/voiceprint_registry.py +179 -0
  245. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/telemetry/perf.py +0 -1
  246. openspeechapi-0.7.0/openspeechapi/vendor_registry.yaml +118 -0
  247. openspeechapi-0.7.0/providers.example.yaml +1060 -0
  248. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/pyproject.toml +84 -25
  249. openspeechapi-0.7.0/scripts/check_benchmark_baselines.py +73 -0
  250. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/macos-stt/install.sh +3 -1
  251. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/macos-stt/macos_stt.swift +22 -0
  252. openspeechapi-0.7.0/scripts/engines/mlx-audio/native/install.sh +202 -0
  253. openspeechapi-0.7.0/scripts/engines/mlx-audio/patches/moss-tts-aim-tokenizer.patch +40 -0
  254. openspeechapi-0.7.0/scripts/engines/mlx-audio/patches/sts-http-endpoint.patch +262 -0
  255. openspeechapi-0.7.0/scripts/engines/mlx-audio/patches/vibevoice-local-tokenizer.patch +62 -0
  256. openspeechapi-0.7.0/scripts/engines/mlx-audio/patches/vibevoice-realtime-session.patch +358 -0
  257. openspeechapi-0.7.0/scripts/engines/mlx-audio/probe.py +26 -0
  258. openspeechapi-0.7.0/scripts/engines/moshi/native/install.sh +109 -0
  259. openspeechapi-0.7.0/scripts/engines/moshi/native/run_service.py +362 -0
  260. openspeechapi-0.7.0/scripts/engines/nemo-speech/native/install.sh +105 -0
  261. openspeechapi-0.7.0/scripts/engines/openmoss/native/install.sh +55 -0
  262. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/sherpa-onnx/native/install.sh +2 -2
  263. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/sherpa-onnx/native/run_streaming_server.py +98 -7
  264. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/whisperlivekit/native/install.sh +2 -2
  265. openspeechapi-0.7.0/scripts/tts_quality_eval.py +278 -0
  266. openspeechapi-0.6.0/openspeechapi/client/client.py +0 -348
  267. openspeechapi-0.6.0/openspeechapi/core/realtime.py +0 -179
  268. openspeechapi-0.6.0/openspeechapi/engine_registry.yaml +0 -699
  269. openspeechapi-0.6.0/openspeechapi/factory.py +0 -459
  270. openspeechapi-0.6.0/openspeechapi/providers/realtime/openai_realtime.py +0 -48
  271. openspeechapi-0.6.0/openspeechapi/providers/realtime/qwen_omni_realtime.py +0 -70
  272. openspeechapi-0.6.0/openspeechapi/providers/stt/alibaba.py +0 -87
  273. openspeechapi-0.6.0/openspeechapi/providers/stt/assemblyai.py +0 -136
  274. openspeechapi-0.6.0/openspeechapi/providers/stt/azure_speech.py +0 -99
  275. openspeechapi-0.6.0/openspeechapi/providers/stt/baidu.py +0 -136
  276. openspeechapi-0.6.0/openspeechapi/providers/stt/deepgram.py +0 -328
  277. openspeechapi-0.6.0/openspeechapi/providers/stt/elevenlabs.py +0 -411
  278. openspeechapi-0.6.0/openspeechapi/providers/stt/faster_whisper.py +0 -247
  279. openspeechapi-0.6.0/openspeechapi/providers/stt/funasr_stt.py +0 -204
  280. openspeechapi-0.6.0/openspeechapi/providers/stt/google_cloud.py +0 -106
  281. openspeechapi-0.6.0/openspeechapi/providers/stt/iflytek.py +0 -682
  282. openspeechapi-0.6.0/openspeechapi/providers/stt/openai.py +0 -100
  283. openspeechapi-0.6.0/openspeechapi/providers/stt/paraformer.py +0 -278
  284. openspeechapi-0.6.0/openspeechapi/providers/stt/parakeet_mlx_stt.py +0 -141
  285. openspeechapi-0.6.0/openspeechapi/providers/stt/sensevoice.py +0 -287
  286. openspeechapi-0.6.0/openspeechapi/providers/stt/tencent.py +0 -213
  287. openspeechapi-0.6.0/openspeechapi/providers/stt/whisper.py +0 -236
  288. openspeechapi-0.6.0/openspeechapi/providers/tts/alibaba.py +0 -96
  289. openspeechapi-0.6.0/openspeechapi/providers/tts/azure_speech.py +0 -123
  290. openspeechapi-0.6.0/openspeechapi/providers/tts/baidu.py +0 -143
  291. openspeechapi-0.6.0/openspeechapi/providers/tts/deepgram.py +0 -192
  292. openspeechapi-0.6.0/openspeechapi/providers/tts/elevenlabs.py +0 -369
  293. openspeechapi-0.6.0/openspeechapi/providers/tts/minimax.py +0 -130
  294. openspeechapi-0.6.0/openspeechapi/providers/tts/openai.py +0 -139
  295. openspeechapi-0.6.0/openspeechapi/providers/tts/tencent.py +0 -189
  296. openspeechapi-0.6.0/openspeechapi/server/webui/app.js +0 -5168
  297. openspeechapi-0.6.0/openspeechapi/server/webui/index.html +0 -358
  298. openspeechapi-0.6.0/openspeechapi/server/webui/styles.css +0 -938
  299. openspeechapi-0.6.0/openspeechapi/vendor_registry.yaml +0 -74
  300. openspeechapi-0.6.0/providers.example.yaml +0 -281
  301. openspeechapi-0.6.0/scripts/release.sh +0 -111
  302. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/__main__.py +0 -0
  303. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/client/__init__.py +0 -0
  304. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/__init__.py +0 -0
  305. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/model_presence.py +0 -0
  306. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/model_profile.py +0 -0
  307. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/registry.py +0 -0
  308. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/settings.py +0 -0
  309. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/core/voice_presets.py +0 -0
  310. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/demo.py +0 -0
  311. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/__init__.py +0 -0
  312. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/context.py +0 -0
  313. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/executors/__init__.py +0 -0
  314. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/executors/base.py +0 -0
  315. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/executors/in_process.py +0 -0
  316. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/executors/remote.py +0 -0
  317. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/fanout.py +0 -0
  318. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/filters.py +0 -0
  319. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/dispatch/watcher.py +0 -0
  320. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/__init__.py +0 -0
  321. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/backends/__init__.py +0 -0
  322. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/base.py +0 -0
  323. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/engines/__init__.py +0 -0
  324. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/engines/faster_whisper.py +0 -0
  325. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/engines/whisper.py +0 -0
  326. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/gemma4_server.py +0 -0
  327. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/indextts_venv.py +0 -0
  328. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/isolated_venv.py +0 -0
  329. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/progress.py +0 -0
  330. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/spark_venv.py +0 -0
  331. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/tasks.py +0 -0
  332. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/venv_common.py +0 -0
  333. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/vllm_gb10_patch.py +0 -0
  334. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/local_engines/vllm_venv.py +0 -0
  335. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/logging_config.py +0 -0
  336. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/observe/__init__.py +0 -0
  337. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/observe/base.py +0 -0
  338. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/observe/latency.py +0 -0
  339. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/observe/metrics.py +0 -0
  340. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/observe/usage.py +0 -0
  341. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/__init__.py +0 -0
  342. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/_template.py +0 -0
  343. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/realtime/__init__.py +0 -0
  344. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/__init__.py +0 -0
  345. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/_local_audio.py +0 -0
  346. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/canary_qwen_stt.py +0 -0
  347. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/kimi_audio_stt.py +0 -0
  348. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/mms_languages.json +0 -0
  349. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/mms_stt.py +0 -0
  350. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/phi4_multimodal_stt.py +0 -0
  351. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/qwen3_omni_stt.py +0 -0
  352. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/voxtral_stt.py +0 -0
  353. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/stt/windows_speech.py +0 -0
  354. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/__init__.py +0 -0
  355. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/macos_say.py +0 -0
  356. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/providers/tts/windows_sapi.py +0 -0
  357. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/__init__.py +0 -0
  358. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/auth.py +0 -0
  359. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/extras_installer.py +0 -0
  360. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/middleware.py +0 -0
  361. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/native_installer.py +0 -0
  362. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/__init__.py +0 -0
  363. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/chat.py +0 -0
  364. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/routes/webui.py +0 -0
  365. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/services/__init__.py +0 -0
  366. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/ws/__init__.py +0 -0
  367. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/server/ws/auth.py +0 -0
  368. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/telemetry/__init__.py +0 -0
  369. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/utils/__init__.py +0 -0
  370. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/utils/audio_converter.py +0 -0
  371. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/openspeechapi/utils/audio_playback.py +0 -0
  372. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/aim_adopt.py +0 -0
  373. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/aim_consumers.py +0 -0
  374. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/cloud/install.sh +0 -0
  375. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/faster-whisper/native/install.sh +0 -0
  376. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/fish-speech/native/install.sh +0 -0
  377. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/macos-stt/_bundle.sh +0 -0
  378. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/macos-stt/request_auth.swift +0 -0
  379. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/engines/whisper/native/install.sh +0 -0
  380. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/gen_mms_languages.py +0 -0
  381. {openspeechapi-0.6.0 → openspeechapi-0.7.0}/scripts/preload_stt_model.py +0 -0
@@ -10,6 +10,8 @@ __pycache__/
10
10
  .coverage
11
11
  dist/
12
12
  build/
13
+ .tmp/
14
+ checkpoints/
13
15
  *.pyc
14
16
  *.pyo
15
17
  .DS_Store
@@ -34,3 +36,9 @@ server_stderr.log
34
36
 
35
37
  # Claude Code project-local config
36
38
  .claude/
39
+
40
+ # Personal captures and generated audio
41
+ /aibox-script/
42
+ /aibox-script.tar.gz
43
+ /output.wav
44
+ /output/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openspeechapi
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Unified speech interface for STT/TTS providers
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: httpx>=0.27
@@ -28,6 +28,14 @@ Provides-Extra: assemblyai-stt
28
28
  Provides-Extra: audio
29
29
  Requires-Dist: numpy; extra == 'audio'
30
30
  Requires-Dist: sounddevice; extra == 'audio'
31
+ Provides-Extra: aws
32
+ Requires-Dist: amazon-transcribe>=0.6.4; extra == 'aws'
33
+ Requires-Dist: boto3; extra == 'aws'
34
+ Provides-Extra: aws-stt
35
+ Requires-Dist: amazon-transcribe>=0.6.4; extra == 'aws-stt'
36
+ Requires-Dist: boto3; extra == 'aws-stt'
37
+ Provides-Extra: aws-tts
38
+ Requires-Dist: boto3; extra == 'aws-tts'
31
39
  Provides-Extra: azure
32
40
  Provides-Extra: azure-stt
33
41
  Provides-Extra: azure-tts
@@ -35,23 +43,33 @@ Provides-Extra: baidu
35
43
  Provides-Extra: baidu-stt
36
44
  Provides-Extra: baidu-tts
37
45
  Provides-Extra: canary-qwen-stt
46
+ Provides-Extra: cartesia
47
+ Requires-Dist: websockets; extra == 'cartesia'
48
+ Provides-Extra: cartesia-stt
49
+ Requires-Dist: websockets; extra == 'cartesia-stt'
50
+ Provides-Extra: cartesia-tts
38
51
  Provides-Extra: chatterbox-tts
39
- Requires-Dist: chatterbox-tts; extra == 'chatterbox-tts'
52
+ Requires-Dist: setuptools<81; extra == 'chatterbox-tts'
40
53
  Requires-Dist: soundfile; extra == 'chatterbox-tts'
41
54
  Provides-Extra: cloud
42
55
  Requires-Dist: websockets; extra == 'cloud'
43
56
  Provides-Extra: coqui-tts
44
- Requires-Dist: coqui-tts[codec,cpu]; extra == 'coqui-tts'
57
+ Requires-Dist: coqui-tts[codec,cpu,zh]; extra == 'coqui-tts'
45
58
  Provides-Extra: deepgram
46
59
  Requires-Dist: websockets; extra == 'deepgram'
60
+ Provides-Extra: deepgram-realtime
61
+ Requires-Dist: websockets; extra == 'deepgram-realtime'
47
62
  Provides-Extra: deepgram-stt
48
63
  Requires-Dist: websockets; extra == 'deepgram-stt'
49
64
  Provides-Extra: deepgram-tts
65
+ Requires-Dist: websockets; extra == 'deepgram-tts'
50
66
  Provides-Extra: dev
51
67
  Requires-Dist: numpy; extra == 'dev'
68
+ Requires-Dist: playwright<2,>=1.58; extra == 'dev'
52
69
  Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
53
70
  Requires-Dist: pytest-cov; extra == 'dev'
54
71
  Requires-Dist: pytest-dotenv; extra == 'dev'
72
+ Requires-Dist: pytest-timeout>=2.3; extra == 'dev'
55
73
  Requires-Dist: pytest>=8.0; extra == 'dev'
56
74
  Requires-Dist: ruff==0.15.*; extra == 'dev'
57
75
  Provides-Extra: dolphin-stt
@@ -64,8 +82,11 @@ Provides-Extra: elevenlabs-stt
64
82
  Requires-Dist: websockets; extra == 'elevenlabs-stt'
65
83
  Provides-Extra: elevenlabs-tts
66
84
  Requires-Dist: elevenlabs; extra == 'elevenlabs-tts'
85
+ Provides-Extra: eval
86
+ Requires-Dist: audiobox-aesthetics; extra == 'eval'
87
+ Requires-Dist: soundfile; extra == 'eval'
67
88
  Provides-Extra: f5-tts
68
- Requires-Dist: f5-tts; extra == 'f5-tts'
89
+ Requires-Dist: f5-tts==1.1.22; extra == 'f5-tts'
69
90
  Requires-Dist: mlx-whisper; (sys_platform == 'darwin') and extra == 'f5-tts'
70
91
  Requires-Dist: soundfile; extra == 'f5-tts'
71
92
  Provides-Extra: faster-whisper-stt
@@ -74,9 +95,11 @@ Provides-Extra: fireredasr-stt
74
95
  Requires-Dist: fireredasr; extra == 'fireredasr-stt'
75
96
  Provides-Extra: fish-speech-tts
76
97
  Provides-Extra: funasr-stt
77
- Requires-Dist: funasr>=1.1.0; extra == 'funasr-stt'
78
- Requires-Dist: torch; extra == 'funasr-stt'
79
- Requires-Dist: torchaudio; extra == 'funasr-stt'
98
+ Requires-Dist: funasr==1.4.16; extra == 'funasr-stt'
99
+ Requires-Dist: torch==2.11.0; extra == 'funasr-stt'
100
+ Requires-Dist: torchaudio==2.11.0; extra == 'funasr-stt'
101
+ Requires-Dist: transformers<5.13,>=4.48; extra == 'funasr-stt'
102
+ Provides-Extra: gemini
80
103
  Provides-Extra: gemma4-stt
81
104
  Requires-Dist: accelerate; (sys_platform != 'darwin') and extra == 'gemma4-stt'
82
105
  Requires-Dist: fastapi; extra == 'gemma4-stt'
@@ -103,8 +126,19 @@ Provides-Extra: kokoro
103
126
  Requires-Dist: kokoro>=0.9.2; extra == 'kokoro'
104
127
  Requires-Dist: misaki[zh]; extra == 'kokoro'
105
128
  Requires-Dist: soundfile; extra == 'kokoro'
129
+ Provides-Extra: local-voiceprint-eres2netv2
130
+ Requires-Dist: modelscope<2,>=1.37; extra == 'local-voiceprint-eres2netv2'
131
+ Requires-Dist: simplejson; extra == 'local-voiceprint-eres2netv2'
132
+ Requires-Dist: sortedcontainers; extra == 'local-voiceprint-eres2netv2'
133
+ Requires-Dist: soundfile; extra == 'local-voiceprint-eres2netv2'
134
+ Requires-Dist: torch; extra == 'local-voiceprint-eres2netv2'
135
+ Requires-Dist: torchaudio; extra == 'local-voiceprint-eres2netv2'
106
136
  Provides-Extra: macos-native
137
+ Provides-Extra: minimax
138
+ Requires-Dist: websockets; extra == 'minimax'
139
+ Provides-Extra: minimax-stt
107
140
  Provides-Extra: minimax-tts
141
+ Requires-Dist: websockets; extra == 'minimax-tts'
108
142
  Provides-Extra: mlx-whisper-stt
109
143
  Requires-Dist: mlx-whisper; (sys_platform == 'darwin') and extra == 'mlx-whisper-stt'
110
144
  Provides-Extra: mms-stt
@@ -115,6 +149,10 @@ Provides-Extra: moonshine-stt
115
149
  Requires-Dist: soundfile; extra == 'moonshine-stt'
116
150
  Requires-Dist: torch; extra == 'moonshine-stt'
117
151
  Requires-Dist: transformers; extra == 'moonshine-stt'
152
+ Provides-Extra: nllb-translation
153
+ Requires-Dist: sentencepiece; extra == 'nllb-translation'
154
+ Requires-Dist: torch; extra == 'nllb-translation'
155
+ Requires-Dist: transformers<6,>=4.46; extra == 'nllb-translation'
118
156
  Provides-Extra: openai
119
157
  Requires-Dist: openai; extra == 'openai'
120
158
  Provides-Extra: openai-stt
@@ -122,9 +160,10 @@ Requires-Dist: openai; extra == 'openai-stt'
122
160
  Provides-Extra: openai-tts
123
161
  Requires-Dist: openai; extra == 'openai-tts'
124
162
  Provides-Extra: paraformer-stt
125
- Requires-Dist: funasr>=1.1.0; extra == 'paraformer-stt'
126
- Requires-Dist: torch; extra == 'paraformer-stt'
127
- Requires-Dist: torchaudio; extra == 'paraformer-stt'
163
+ Requires-Dist: funasr==1.4.16; extra == 'paraformer-stt'
164
+ Requires-Dist: torch==2.11.0; extra == 'paraformer-stt'
165
+ Requires-Dist: torchaudio==2.11.0; extra == 'paraformer-stt'
166
+ Requires-Dist: transformers<5.13,>=4.48; extra == 'paraformer-stt'
128
167
  Provides-Extra: parakeet-stt
129
168
  Requires-Dist: parakeet-mlx; (sys_platform == 'darwin') and extra == 'parakeet-stt'
130
169
  Provides-Extra: phi4-multimodal-stt
@@ -139,6 +178,9 @@ Requires-Dist: torchvision; extra == 'phi4-multimodal-stt'
139
178
  Requires-Dist: transformers; extra == 'phi4-multimodal-stt'
140
179
  Provides-Extra: piper-tts
141
180
  Requires-Dist: piper-tts; extra == 'piper-tts'
181
+ Provides-Extra: pyannote-diarization
182
+ Requires-Dist: numpy; extra == 'pyannote-diarization'
183
+ Requires-Dist: pyannote-audio<4.1,>=4.0; extra == 'pyannote-diarization'
142
184
  Provides-Extra: qwen3-asr-stt
143
185
  Requires-Dist: modelscope; extra == 'qwen3-asr-stt'
144
186
  Requires-Dist: qwen-asr; extra == 'qwen3-asr-stt'
@@ -148,17 +190,28 @@ Requires-Dist: qwen-omni-utils; extra == 'qwen3-omni-stt'
148
190
  Requires-Dist: torch; extra == 'qwen3-omni-stt'
149
191
  Requires-Dist: transformers; extra == 'qwen3-omni-stt'
150
192
  Provides-Extra: sensevoice-stt
151
- Requires-Dist: funasr>=1.1.0; extra == 'sensevoice-stt'
152
- Requires-Dist: torch; extra == 'sensevoice-stt'
153
- Requires-Dist: torchaudio; extra == 'sensevoice-stt'
193
+ Requires-Dist: funasr==1.4.16; extra == 'sensevoice-stt'
194
+ Requires-Dist: torch==2.11.0; extra == 'sensevoice-stt'
195
+ Requires-Dist: torchaudio==2.11.0; extra == 'sensevoice-stt'
196
+ Requires-Dist: transformers<5.13,>=4.48; extra == 'sensevoice-stt'
154
197
  Provides-Extra: server
155
198
  Requires-Dist: ai-model-manager>=0.2.1; extra == 'server'
156
199
  Requires-Dist: fastapi; extra == 'server'
200
+ Requires-Dist: numpy>=1.26; extra == 'server'
157
201
  Requires-Dist: python-multipart; extra == 'server'
158
202
  Requires-Dist: uvicorn; extra == 'server'
159
203
  Requires-Dist: websockets; extra == 'server'
160
204
  Provides-Extra: sherpa-onnx-stt
161
205
  Requires-Dist: websockets; extra == 'sherpa-onnx-stt'
206
+ Provides-Extra: silero-vad
207
+ Requires-Dist: silero-vad[onnx-cpu]==6.2.3; extra == 'silero-vad'
208
+ Provides-Extra: smart-turn
209
+ Requires-Dist: numpy>=1.26; extra == 'smart-turn'
210
+ Requires-Dist: onnxruntime>=1.18; extra == 'smart-turn'
211
+ Provides-Extra: speechmatics
212
+ Requires-Dist: websockets; extra == 'speechmatics'
213
+ Provides-Extra: speechmatics-stt
214
+ Requires-Dist: websockets; extra == 'speechmatics-stt'
162
215
  Provides-Extra: tencent
163
216
  Provides-Extra: tencent-stt
164
217
  Provides-Extra: tencent-tts
@@ -171,6 +224,9 @@ Provides-Extra: volcengine-tts
171
224
  Provides-Extra: vosk-stt
172
225
  Requires-Dist: huggingface-hub; extra == 'vosk-stt'
173
226
  Requires-Dist: vosk; extra == 'vosk-stt'
227
+ Provides-Extra: voxcpm
228
+ Requires-Dist: soundfile; extra == 'voxcpm'
229
+ Requires-Dist: voxcpm; extra == 'voxcpm'
174
230
  Provides-Extra: voxtral-stt
175
231
  Requires-Dist: accelerate; extra == 'voxtral-stt'
176
232
  Requires-Dist: mistral-common[audio]>=1.8.1; extra == 'voxtral-stt'
@@ -309,6 +365,20 @@ python -m openspeechapi.cli --config providers.yaml serve
309
365
  > 授权和听写模型下载是 macOS TCC 系统限制,无法自动化,必须每台机器手动执行一次。
310
366
  > 详细机制见 [docs/architecture/native-engine-install.md](docs/architecture/native-engine-install.md)。
311
367
 
368
+ ### 部署机(macOS)常驻运行与重启
369
+
370
+ `scripts/restart-osa.sh` 从源码 checkout 重启 macOS 上的常驻服务。直接运行时使用
371
+ 仓库的 `.venv` 和 `providers.yaml`,日志写入 `serve.log`,默认绑定 `127.0.0.1:8600`。
372
+
373
+ ```bash
374
+ bash scripts/restart-osa.sh
375
+ ```
376
+
377
+ 将机器专属设置放在 `$XDG_CONFIG_HOME/openspeechapi/restart.env`,未设置 XDG 时使用
378
+ `~/.config/openspeechapi/restart.env`。该文件由 Bash 加载,只放自己信任的配置。
379
+ 也可用 `OSA_RESTART_CONFIG` 指向另一个文件。示例与字段说明见
380
+ [本机部署配置](docs/operations/local-restart.md)。
381
+
312
382
  ## CLI Demo
313
383
 
314
384
  无需写代码,直接在命令行体验:
@@ -376,7 +446,23 @@ python -m openspeechapi.cli engine start --name whisper --runtime native --fol
376
446
  python -m openspeechapi.cli engine status --name whisper --runtime native
377
447
  ```
378
448
 
379
- 说明:安装会优先读取 `~/.aim/config.json + ~/.aim/registry.json` 的 provision 信息来定位模型;若 AIM 未命中,再回退默认本地路径候选。若仍未找到,可按配置走“模拟下载”流程以验证安装进度。
449
+ 说明:安装会优先通过 `aim resolve ... --json` 获取模型路径;OSA 不直接解析 AIM 私有配置文件。
450
+ 若 AIM 未命中,再回退默认本地路径候选。若仍未找到,可按配置走“模拟下载”流程以验证安装进度。
451
+
452
+ ### Audio Toolkit 与推荐配置
453
+
454
+ 0.7 开发线增加独立 Translation、Audio Analysis、Pipeline、Realtime/STS 和 mlx-audio 后端。
455
+ 这些能力不会自动替换现有 Provider;请按平台、任务和许可显式选择:
456
+
457
+ - [Provider 迁移策略与推荐 Profile](docs/architecture/provider-migration-and-recommended-profiles.md)
458
+ - [模型许可与平台兼容矩阵](docs/architecture/model-license-platform-matrix.md)
459
+ - [Realtime 与本地 Speech-to-Speech](docs/architecture/realtime-speech-to-speech.md)
460
+ - [0.6.x 升级到 0.7](docs/UPGRADING-0.7.md)
461
+ - [0.7.0 发布说明草案](docs/releases/0.7.0-audio-toolkit.md)
462
+
463
+ 当前模型状态包括 `researched`、`probed`、`benchmarked` 和 `experimental`;只有满足
464
+ 模型来源/许可、AIM、manifest、Provider 测试、UI E2E、实机基准和用户文档全部门槛后才会标记
465
+ `supported`。
380
466
 
381
467
  ### Demo 音频播放
382
468
 
@@ -421,7 +507,9 @@ python -m openspeechapi.demo tts -t "Hello world" --play \
421
507
  | `mms` | STT | Meta MMS(Wav2Vec2-CTC,1000+ 语言含 zh/en,按 ISO 639-3 选语言) | subprocess | `pip install -e ".[mms-stt]"` |
422
508
  | `openai-tts` | TTS | OpenAI Speech API(云端,支持流式) | remote | `pip install -e ".[openai]"` |
423
509
  | `elevenlabs` | TTS | ElevenLabs 高质量语音(云端,支持 HTTP/WS 流式) | remote | `pip install -e ".[elevenlabs-tts]"` |
424
- | `minimax` | TTS | Minimax 语音合成(云端) | remote | `pip install -e ".[minimax]"` |
510
+ | `minimax` | TTS | MiniMax Speech 2.8/2.6 同步、HTTP/WS 与增量文本流式合成 | remote | `pip install -e ".[minimax]"` |
511
+ | `minimax-long-tts` | TTS | MiniMax 异步长文本合成和持久进度 | remote | `pip install -e ".[minimax]"` |
512
+ | `minimax-stt` | STT | MiniMax 文件转写、说话人、时间戳和字幕 | remote | `pip install -e ".[minimax]"` |
425
513
  | `cosyvoice` | TTS | CosyVoice 本地中文语音合成(GPU) | subprocess | 需手动安装 CosyVoice |
426
514
  | `fish-speech` | TTS | Fish-Speech 本地多语 TTS + voice clone | local | `pip install -e ".[fish-speech]"` |
427
515
  | `piper` | TTS | Piper 轻量级本地 TTS(CPU 即可) | in_process | `pip install -e ".[piper]"` |
@@ -728,13 +816,18 @@ create_provider("elevenlabs",
728
816
  ```python
729
817
  create_provider("minimax",
730
818
  api_key="...", # 必填,Minimax API Key
731
- group_id="...", # 必填,Minimax Group ID
732
- model="speech-01-turbo", # 模型
733
- voice_id="male-qn-qingse", # 声音 ID
819
+ base_url="https://api.minimax.io",
820
+ model="speech-2.8-turbo", # 当前模型
821
+ voice_id="Chinese (Mandarin)_Reliable_Executive",
734
822
  speed=1.0, # 语速
735
823
  )
736
824
  ```
737
825
 
826
+ MiniMax 还提供 `minimax-stt`、`minimax-long-tts`、`minimax-voice-tools`、
827
+ `minimax-music` 和 `minimax-lyrics`。当前 API 使用 Bearer Key,旧 `group_id`
828
+ 仅为配置兼容保留。完整产品范围、参数和 2026 年音乐服务授权边界见
829
+ [MiniMax 产品矩阵](docs/engines/minimax-product-matrix.md)。
830
+
738
831
  ### `cosyvoice`
739
832
 
740
833
  ```python
@@ -121,6 +121,20 @@ python -m openspeechapi.cli --config providers.yaml serve
121
121
  > 授权和听写模型下载是 macOS TCC 系统限制,无法自动化,必须每台机器手动执行一次。
122
122
  > 详细机制见 [docs/architecture/native-engine-install.md](docs/architecture/native-engine-install.md)。
123
123
 
124
+ ### 部署机(macOS)常驻运行与重启
125
+
126
+ `scripts/restart-osa.sh` 从源码 checkout 重启 macOS 上的常驻服务。直接运行时使用
127
+ 仓库的 `.venv` 和 `providers.yaml`,日志写入 `serve.log`,默认绑定 `127.0.0.1:8600`。
128
+
129
+ ```bash
130
+ bash scripts/restart-osa.sh
131
+ ```
132
+
133
+ 将机器专属设置放在 `$XDG_CONFIG_HOME/openspeechapi/restart.env`,未设置 XDG 时使用
134
+ `~/.config/openspeechapi/restart.env`。该文件由 Bash 加载,只放自己信任的配置。
135
+ 也可用 `OSA_RESTART_CONFIG` 指向另一个文件。示例与字段说明见
136
+ [本机部署配置](docs/operations/local-restart.md)。
137
+
124
138
  ## CLI Demo
125
139
 
126
140
  无需写代码,直接在命令行体验:
@@ -188,7 +202,23 @@ python -m openspeechapi.cli engine start --name whisper --runtime native --fol
188
202
  python -m openspeechapi.cli engine status --name whisper --runtime native
189
203
  ```
190
204
 
191
- 说明:安装会优先读取 `~/.aim/config.json + ~/.aim/registry.json` 的 provision 信息来定位模型;若 AIM 未命中,再回退默认本地路径候选。若仍未找到,可按配置走“模拟下载”流程以验证安装进度。
205
+ 说明:安装会优先通过 `aim resolve ... --json` 获取模型路径;OSA 不直接解析 AIM 私有配置文件。
206
+ 若 AIM 未命中,再回退默认本地路径候选。若仍未找到,可按配置走“模拟下载”流程以验证安装进度。
207
+
208
+ ### Audio Toolkit 与推荐配置
209
+
210
+ 0.7 开发线增加独立 Translation、Audio Analysis、Pipeline、Realtime/STS 和 mlx-audio 后端。
211
+ 这些能力不会自动替换现有 Provider;请按平台、任务和许可显式选择:
212
+
213
+ - [Provider 迁移策略与推荐 Profile](docs/architecture/provider-migration-and-recommended-profiles.md)
214
+ - [模型许可与平台兼容矩阵](docs/architecture/model-license-platform-matrix.md)
215
+ - [Realtime 与本地 Speech-to-Speech](docs/architecture/realtime-speech-to-speech.md)
216
+ - [0.6.x 升级到 0.7](docs/UPGRADING-0.7.md)
217
+ - [0.7.0 发布说明草案](docs/releases/0.7.0-audio-toolkit.md)
218
+
219
+ 当前模型状态包括 `researched`、`probed`、`benchmarked` 和 `experimental`;只有满足
220
+ 模型来源/许可、AIM、manifest、Provider 测试、UI E2E、实机基准和用户文档全部门槛后才会标记
221
+ `supported`。
192
222
 
193
223
  ### Demo 音频播放
194
224
 
@@ -233,7 +263,9 @@ python -m openspeechapi.demo tts -t "Hello world" --play \
233
263
  | `mms` | STT | Meta MMS(Wav2Vec2-CTC,1000+ 语言含 zh/en,按 ISO 639-3 选语言) | subprocess | `pip install -e ".[mms-stt]"` |
234
264
  | `openai-tts` | TTS | OpenAI Speech API(云端,支持流式) | remote | `pip install -e ".[openai]"` |
235
265
  | `elevenlabs` | TTS | ElevenLabs 高质量语音(云端,支持 HTTP/WS 流式) | remote | `pip install -e ".[elevenlabs-tts]"` |
236
- | `minimax` | TTS | Minimax 语音合成(云端) | remote | `pip install -e ".[minimax]"` |
266
+ | `minimax` | TTS | MiniMax Speech 2.8/2.6 同步、HTTP/WS 与增量文本流式合成 | remote | `pip install -e ".[minimax]"` |
267
+ | `minimax-long-tts` | TTS | MiniMax 异步长文本合成和持久进度 | remote | `pip install -e ".[minimax]"` |
268
+ | `minimax-stt` | STT | MiniMax 文件转写、说话人、时间戳和字幕 | remote | `pip install -e ".[minimax]"` |
237
269
  | `cosyvoice` | TTS | CosyVoice 本地中文语音合成(GPU) | subprocess | 需手动安装 CosyVoice |
238
270
  | `fish-speech` | TTS | Fish-Speech 本地多语 TTS + voice clone | local | `pip install -e ".[fish-speech]"` |
239
271
  | `piper` | TTS | Piper 轻量级本地 TTS(CPU 即可) | in_process | `pip install -e ".[piper]"` |
@@ -540,13 +572,18 @@ create_provider("elevenlabs",
540
572
  ```python
541
573
  create_provider("minimax",
542
574
  api_key="...", # 必填,Minimax API Key
543
- group_id="...", # 必填,Minimax Group ID
544
- model="speech-01-turbo", # 模型
545
- voice_id="male-qn-qingse", # 声音 ID
575
+ base_url="https://api.minimax.io",
576
+ model="speech-2.8-turbo", # 当前模型
577
+ voice_id="Chinese (Mandarin)_Reliable_Executive",
546
578
  speed=1.0, # 语速
547
579
  )
548
580
  ```
549
581
 
582
+ MiniMax 还提供 `minimax-stt`、`minimax-long-tts`、`minimax-voice-tools`、
583
+ `minimax-music` 和 `minimax-lyrics`。当前 API 使用 Bearer Key,旧 `group_id`
584
+ 仅为配置兼容保留。完整产品范围、参数和 2026 年音乐服务授权边界见
585
+ [MiniMax 产品矩阵](docs/engines/minimax-product-matrix.md)。
586
+
550
587
  ### `cosyvoice`
551
588
 
552
589
  ```python
@@ -12,13 +12,48 @@ except PackageNotFoundError: # running from a raw source tree that was never in
12
12
  from pathlib import Path
13
13
 
14
14
  from openspeechapi.config import load_config
15
- from openspeechapi.core.base import SpeechProvider, STTProvider, TTSProvider
15
+ from openspeechapi.core.base import (
16
+ AudioAnalysisProvider,
17
+ SpeechProvider,
18
+ STTProvider,
19
+ TranslationProvider,
20
+ TTSProvider,
21
+ )
16
22
  from openspeechapi.core.enums import AudioFormat, Capability, ExecMode, ProviderType
17
- from openspeechapi.core.models import AudioChunk, AudioData, STTOptions, Transcription, TTSOptions, Word
23
+ from openspeechapi.core.events import StreamEvent, StreamEventType
24
+ from openspeechapi.core.features import FeatureDescriptor, FeatureSupport
25
+ from openspeechapi.core.jobs import JobRecord, JobStatus, JsonJobStore, artifact_cache_key
26
+ from openspeechapi.core.transcript_events import TranscriptEventAdapter
27
+ from openspeechapi.core.models import (
28
+ AnalysisArtifact,
29
+ AnalysisTaskDescriptor,
30
+ AudioAnalysisRequest,
31
+ AudioAnalysisResult,
32
+ AudioChunk,
33
+ AudioData,
34
+ AudioEvent,
35
+ Chapter,
36
+ Entity,
37
+ Provenance,
38
+ Sentiment,
39
+ Speaker,
40
+ STTOptions,
41
+ Transcription,
42
+ TranscriptSegment,
43
+ TranslationRequest,
44
+ TranslationResult,
45
+ TranslationSegment,
46
+ TTSOptions,
47
+ Word,
48
+ )
18
49
  from openspeechapi.core.registry import ProviderRegistry
19
50
  from openspeechapi.core.settings import BaseSettings
20
51
  from openspeechapi.dispatch.context import InvokeContext
21
52
  from openspeechapi.dispatch.dispatcher import ServiceDispatcher
53
+ from openspeechapi.dispatch.speaker_attribution import (
54
+ SpeakerAttributionAdapter,
55
+ attribute_transcription_speakers,
56
+ )
22
57
  from openspeechapi.client.client import Client
23
58
  from openspeechapi.factory import create_default_registry, create_provider, list_providers
24
59
  from openspeechapi.logging_config import (
@@ -66,7 +101,11 @@ def list_configured_engines(
66
101
 
67
102
 
68
103
  __all__ = [
69
- "AudioChunk", "AudioData", "AudioFormat", "BaseSettings", "Capability",
104
+ "AnalysisArtifact", "AnalysisTaskDescriptor", "AudioAnalysisProvider",
105
+ "AudioAnalysisRequest", "AudioAnalysisResult", "AudioChunk", "AudioData", "AudioEvent",
106
+ "AudioFormat", "BaseSettings", "Capability",
107
+ "Chapter", "Entity", "FeatureDescriptor", "FeatureSupport",
108
+ "JobRecord", "JobStatus", "JsonJobStore", "artifact_cache_key",
70
109
  "Client", "ConfigError", "Event", "ExecMode", "FanOutAllFailedError", "InvokeContext",
71
110
  "PerfTimer",
72
111
  "bind_context", "configure_logging", "get_integration_tag", "get_log_settings",
@@ -76,7 +115,11 @@ __all__ = [
76
115
  "OpenSpeechError", "ProviderCrashedError", "ProviderError",
77
116
  "ProviderNotFoundError", "ProviderRegistry", "ProviderType",
78
117
  "ProviderUnavailableError", "STTOptions", "STTProvider", "ServiceDispatcher",
79
- "SpeechProvider", "TTSOptions", "TTSProvider", "Transcription", "Word",
118
+ "Provenance", "Sentiment", "Speaker", "SpeechProvider", "StreamEvent", "StreamEventType",
119
+ "SpeakerAttributionAdapter", "attribute_transcription_speakers",
120
+ "TranscriptSegment", "TranslationProvider", "TranslationRequest", "TranslationResult",
121
+ "TranscriptEventAdapter",
122
+ "TranslationSegment", "TTSOptions", "TTSProvider", "Transcription", "Word",
80
123
  "list_output_devices", "play_audio",
81
124
  "load_config",
82
125
  ]
@@ -0,0 +1,9 @@
1
+ """语音工具箱:ClearerVoice 等语音前端处理工具的轻量测试封装。
2
+
3
+ 区别于 STT/TTS(语音↔文本),这类工具做**语音→语音 / 语音→多语音**的前端处理(分离/降噪/
4
+ 超分/目标说话人提取)。依赖(clearvoice + torch)装在**独立 venv**,OSA 主进程通过 subprocess
5
+ 调用(见 runner),不污染主 venv、不进 provider 引擎体系 —— 定位是测试台。
6
+ """
7
+ from openspeechapi.audio_toolkit.runner import clearvoice_available, clearvoice_python, process
8
+
9
+ __all__ = ["clearvoice_available", "clearvoice_python", "process"]
@@ -0,0 +1,110 @@
1
+ """OSA 侧:通过 subprocess 调 clearvoice 独立 venv 的 worker(见 worker.py)。
2
+
3
+ clearvoice venv 的解析优先级:
4
+ 1. 环境变量 ``OSA_CLEARVOICE_PYTHON``(显式指定 venv 的 python)
5
+ 2. 约定生产位置 ``~/AI/venvs/clearvoice/.venv/bin/python``(与 isolated_venv 引擎同风格)
6
+
7
+ 任一命中即用;都没有 → 不可用(端点降级提示去装,绝不 500)。
8
+ """
9
+ from __future__ import annotations
10
+
11
+ import json
12
+ import os
13
+ import subprocess
14
+ import tempfile
15
+
16
+ from loguru import logger
17
+
18
+ _WORKER = os.path.join(os.path.dirname(__file__), "worker.py")
19
+
20
+
21
+ def clearvoice_python() -> str | None:
22
+ """clearvoice 独立 venv 的 python 解释器路径,找不到返回 None。"""
23
+ env = os.environ.get("OSA_CLEARVOICE_PYTHON")
24
+ if env and os.path.exists(env):
25
+ return env
26
+ default = os.path.expanduser("~/AI/venvs/clearvoice/.venv/bin/python")
27
+ return default if os.path.exists(default) else None
28
+
29
+
30
+ def clearvoice_available() -> bool:
31
+ return clearvoice_python() is not None
32
+
33
+
34
+ def process(
35
+ task: str,
36
+ model: str,
37
+ input_wav: bytes,
38
+ timeout: int = 900,
39
+ model_dir: str = "",
40
+ ) -> dict:
41
+ """对 WAV 字节跑一次 clearvoice 处理。返回 {ok, outputs:[{name, audio(bytes)}], error}。
42
+
43
+ 不抛异常 —— venv 缺失 / worker 失败 / 超时都以 ``{"ok": False, "error": ...}`` 返回,
44
+ 由端点转成可读错误(测试台不该因处理器问题 500)。
45
+ """
46
+ py = clearvoice_python()
47
+ if not py:
48
+ return {"ok": False, "error": (
49
+ "clearvoice 独立 venv 未安装。请在 ~/AI/venvs/clearvoice 建 venv 并 "
50
+ "`pip install clearvoice`,或设环境变量 OSA_CLEARVOICE_PYTHON 指向其 python。")}
51
+
52
+ with tempfile.TemporaryDirectory(prefix="cv_toolkit_") as tmp:
53
+ in_path = os.path.join(tmp, "input.wav")
54
+ out_dir = os.path.join(tmp, "out")
55
+ cwd = None
56
+ if model_dir:
57
+ resolved_model_dir = os.path.realpath(os.path.expanduser(model_dir))
58
+ if not os.path.isdir(resolved_model_dir):
59
+ return {"ok": False, "error": f"ClearerVoice model directory not found: {model_dir}"}
60
+ checkpoint_marker = os.path.join(resolved_model_dir, "last_best_checkpoint")
61
+ try:
62
+ with open(checkpoint_marker, encoding="utf-8") as marker:
63
+ checkpoint_name = marker.read().strip()
64
+ except OSError:
65
+ checkpoint_name = ""
66
+ checkpoint_file = os.path.join(resolved_model_dir, checkpoint_name)
67
+ if not checkpoint_name or not os.path.isfile(checkpoint_file):
68
+ return {
69
+ "ok": False,
70
+ "error": f"ClearerVoice model directory is incomplete: {model_dir}",
71
+ }
72
+ checkpoints_dir = os.path.join(tmp, "checkpoints")
73
+ os.makedirs(checkpoints_dir, exist_ok=True)
74
+ os.symlink(resolved_model_dir, os.path.join(checkpoints_dir, model))
75
+ cwd = tmp
76
+ with open(in_path, "wb") as f:
77
+ f.write(input_wav)
78
+ try:
79
+ r = subprocess.run(
80
+ [py, _WORKER, "--task", task, "--model", model,
81
+ "--input", in_path, "--output-dir", out_dir],
82
+ capture_output=True, text=True, timeout=timeout, cwd=cwd)
83
+ except subprocess.TimeoutExpired:
84
+ return {"ok": False, "error": f"处理超时(>{timeout}s) —— 模型首次下载或音频过长?"}
85
+
86
+ # worker 把结构化结果打在 stdout 最后一行(前面可能有 clearvoice 的进度输出)
87
+ last = ""
88
+ for line in reversed(r.stdout.strip().splitlines()):
89
+ if line.strip().startswith("{"):
90
+ last = line.strip()
91
+ break
92
+ try:
93
+ result = json.loads(last)
94
+ except (json.JSONDecodeError, ValueError):
95
+ logger.warning("clearvoice worker 输出解析失败 rc={} stderr={}", r.returncode, r.stderr[:300])
96
+ return {"ok": False, "error": (r.stderr.strip()[-300:] or r.stdout.strip()[-300:] or
97
+ f"worker 无有效输出(rc={r.returncode})")}
98
+ if not result.get("ok"):
99
+ return result
100
+
101
+ outs = []
102
+ for p in result.get("outputs", []):
103
+ try:
104
+ with open(p, "rb") as f:
105
+ outs.append({"name": os.path.basename(p), "audio": f.read()})
106
+ except OSError as e:
107
+ logger.warning("读取分离输出失败 {}: {}", p, e)
108
+ if not outs:
109
+ return {"ok": False, "error": "处理成功但读取输出音频失败"}
110
+ return {"ok": True, "outputs": outs}
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env python3
2
+ """ClearerVoice 处理 worker —— 在 clearvoice 独立 venv 里跑,被 OSA 经 subprocess 调用。
3
+
4
+ 隔离原因:clearvoice 拉 torch/torchaudio 全套,不该塞进 OSA 主 venv;且这是测试台,进程级
5
+ 隔离最省心(崩了不影响 OSA)。IPC 极简:文件传音频 + stdout 传 JSON 结果(最后一行)。
6
+
7
+ 用法:
8
+ python worker.py --task speech_separation --model MossFormer2_SS_16K \\
9
+ --input in.wav --output-dir out/
10
+ 输出(stdout 最后一行 JSON): {"ok": true, "outputs": ["out/.../xxx.wav", ...]}
11
+ 或 {"ok": false, "error": "..."}
12
+ """
13
+ import os
14
+
15
+ os.environ.setdefault("HF_ENDPOINT", "https://hf-mirror.com") # 受限网络:模型走镜像
16
+ os.environ.setdefault("HF_HUB_DISABLE_XET", "1") # 禁 HF Xet CAS
17
+
18
+ import argparse
19
+ import glob
20
+ import json
21
+ import sys
22
+
23
+
24
+ def main() -> int:
25
+ ap = argparse.ArgumentParser()
26
+ ap.add_argument("--task", required=True, help="clearvoice task, e.g. speech_separation")
27
+ ap.add_argument("--model", required=True, help="model name, e.g. MossFormer2_SS_16K")
28
+ ap.add_argument("--input", required=True, help="输入音频路径")
29
+ ap.add_argument("--output-dir", required=True, help="输出目录")
30
+ args = ap.parse_args()
31
+
32
+ try:
33
+ from clearvoice import ClearVoice
34
+ cv = ClearVoice(task=args.task, model_names=[args.model])
35
+ os.makedirs(args.output_dir, exist_ok=True)
36
+ cv(input_path=args.input, online_write=True, output_path=args.output_dir)
37
+ outputs = sorted(glob.glob(os.path.join(args.output_dir, "**", "*.wav"), recursive=True))
38
+ if not outputs:
39
+ print(json.dumps({"ok": False, "error": "处理完成但无输出音频"}))
40
+ return 1
41
+ print(json.dumps({"ok": True, "outputs": outputs}))
42
+ return 0
43
+ except Exception as e: # noqa: BLE001 - 任何失败都回传结构化错误,不裸崩
44
+ print(json.dumps({"ok": False, "error": f"{type(e).__name__}: {e}"}))
45
+ return 1
46
+
47
+
48
+ if __name__ == "__main__":
49
+ sys.exit(main())