Wait for kReady before sending audio — via callback or polling
A processor connects to the Sanas cloud asynchronously. You must wait for kReady before sending audio. If you call ProcessSamples before the processor is ready, the output buffer is filled with silence.
States
State
Meaning
kInitializing
Connecting to the server — do not send audio yet.
kReady
Connected and ready — safe to call ProcessSamples.
kFailed
Connection or processing error. Destroy and recreate the processor.
kDisconnected
Was connected; the connection dropped. Destroy and recreate if needed.
kUnknown
Initial state before connection begins.
Option A — State callback (recommended)
Pass a ProcessorStateCallback when creating the processor. It fires on a background thread — keep it fast and thread-safe.
std::atomic<bool> ready{false}, failed{false};auto onState = [&](ProcessorState s, std::string reason) { if (s == ProcessorState::kReady) ready = true; else if (s == ProcessorState::kFailed || s == ProcessorState::kDisconnected) failed = true;};auto p = sdk->CreateAudioProcessor(params, rc, onState);while (!ready && !failed) std::this_thread::sleep_for(std::chrono::milliseconds(50));
Option B — Polling
Useful if you prefer not to use callbacks.
// Instant checkif (processor->GetState() == ProcessorState::kReady) { /* ... */ }// Drain all queued state changes (non-blocking)ProcessorStateChange change;while (processor->GetNextStateChange(change)) handle(change.state, change.reason);// Block until the next change (use a dedicated monitor thread)if (processor->WaitForStateChange(change, /*timeoutMs=*/5000)) { /* ... */ }
Do not call WaitForStateChange from your audio thread. Use a dedicated monitor thread or the callback approach instead.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Sanas Developer Hub","colors":{"primary":"#35CC88","light":"#3ED993","dark":"#35CC88"},"logo":{"light":"https://mintcdn.com/sanasai/ee_zurYLRvrMIUlJ/images/Sanaslogolight.svg?fit=max\u0026auto=format\u0026n=ee_zurYLRvrMIUlJ\u0026q=85\u0026s=13a3edb3ffab3c1a310d1ac462065cf8","dark":"https://mintcdn.com/sanasai/ee_zurYLRvrMIUlJ/images/Sanaslogodark.svg?fit=max\u0026auto=format\u0026n=ee_zurYLRvrMIUlJ\u0026q=85\u0026s=6d9480cfff4024fdeb386294ca9eac7b"},"favicon":"https://mintcdn.com/sanasai/ee_zurYLRvrMIUlJ/images/favicon.svg?fit=max\u0026auto=format\u0026n=ee_zurYLRvrMIUlJ\u0026q=85\u0026s=f895522ae0c9e0c9d2354269cf7c2477","appearance":{"default":"system"},"navbar":{"links":[{"href":"https://support.sanas.ai","label":"Support"},{"href":"https://www.sanas.ai/science","label":"Blog"}]},"footer":{"socials":{"website":"https://sanas.ai","linkedin":"https://www.linkedin.com/company/sanastech"},"links":[{"header":"Sanas","items":[{"label":"sanas.ai","href":"https://sanas.ai"}]}]},"integrations":{"posthog":{"apiKey":"phc_2tzzmgZZP01Tsu0lIlQbUhxP9b7ErKblhTXCHDRhA7z","sessionRecording":true}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sanasai","hasAudioNarration":false,"actualSubdomain":"sanasai","customDomains":["developer.sanas.ai"],"gitSource":{"type":"gitlab","owner":"sanas-ai/developer-documentation","repo":"sanas-developer-documentation","deployBranch":"main","contentDirectory":"","isPrivate":true,"projectId":78221495,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6afaa49d00a05067262f9b95","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Docs","count":28},{"language":"default","tag":"Models","count":13},{"language":"default","tag":"Human ↔ Human","count":7},{"language":"default","tag":"Speech Enhancement","count":5},{"language":"default","tag":"Human ↔ Machine","count":4},{"language":"default","tag":"Agentic Speech Enhancement","count":4},{"language":"default","tag":"Deployment","count":3},{"language":"default","tag":"Enterprise","count":3},{"language":"default","tag":"Getting Started","count":3},{"language":"default","tag":"Resources","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"css/custom.css","content":"@font-face{font-family:'Sequel Sans';src:url('/fonts/SequelSans-DisplayBook.woff2') format('woff2');font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:'Sequel Sans';src:url('/fonts/SequelSans-Display.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:'Sequel Sans';src:url('/fonts/SequelSans-DisplayMedium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:'Sequel Sans';src:url('/fonts/SequelSans-DisplayBold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}body,h1,h2,h3,h4,h5,h6,p,li,td,th,a,div{font-family:'Sequel Sans', Helvetica, Arial, sans-serif!important}code,pre,pre code,pre span,.code-block,[class*=\"code\"]{font-family:'SF Mono', ui-monospace, Menlo, Monaco, 'Cascadia Code', monospace!important}h2{margin-top:1.5rem!important}h2:first-of-type{margin-top:0.5rem!important}h3{margin-top:1rem!important}article>div:first-child>p:first-child{margin-top:-0.5rem!important}table td:first-child,table th:first-child{min-width:220px!important}table td:nth-child(2),table th:nth-child(2){min-width:160px!important}table{table-layout:fixed!important;width:100%!important}table a{font-weight:400!important}nav img[alt=\"light logo\"],nav img[alt=\"dark logo\"]{max-height:20px!important}.tag-h2h,.tag-h2m{display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;border-radius:20px;letter-spacing:0.03em;background:#F7F7F7;color:#242424}"}]}
{"page":{"pagePath":"API-Reference/Cpp-SDK/Guides/Processor-States","slug":"/API-Reference/Cpp-SDK/Guides/Processor-States","pageMetadata":{"title":"Processor State Handling","description":"Wait for kReady before sending audio — via callback or polling","icon":"signal","href":"/API-Reference/Cpp-SDK/Guides/Processor-States","hidden":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Wait for kReady before sending audio — via callback or polling\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`A processor connects to the Sanas cloud asynchronously. You must wait for `,_jsx(_components.code,{children:`kReady`}),` before sending audio. If you call `,_jsx(_components.code,{children:`ProcessSamples`}),` before the processor is ready, the output buffer is filled with silence.`]}),`\n`,_jsx(Heading,{level:`2`,id:`states`,children:`States`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`State`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`kInitializing`})}),_jsx(_components.td,{children:`Connecting to the server — do not send audio yet.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`kReady`})}),_jsxs(_components.td,{children:[`Connected and ready — safe to call `,_jsx(_components.code,{children:`ProcessSamples`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`kFailed`})}),_jsx(_components.td,{children:`Connection or processing error. Destroy and recreate the processor.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`kDisconnected`})}),_jsx(_components.td,{children:`Was connected; the connection dropped. Destroy and recreate if needed.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`kUnknown`})}),_jsx(_components.td,{children:`Initial state before connection begins.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`option-a-—-state-callback-recommended`,children:`Option A — State callback (recommended)`}),`\n`,_jsxs(_components.p,{children:[`Pass a `,_jsx(_components.code,{children:`ProcessorStateCallback`}),` when creating the processor. It fires on a background thread — keep it fast and thread-safe.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`std`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::atomic`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`bool`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ready{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}, failed{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`auto`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` onState `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ProcessorState`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`std`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reason`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (s `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` ProcessorState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::kReady) ready `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (s `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` ProcessorState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::kFailed `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`||`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` ProcessorState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::kDisconnected) failed `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`auto`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` p `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`CreateAudioProcessor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(params, rc, onState);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ready `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026\u0026`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`failed)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` std`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`this_thread`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`sleep_for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`std`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`chrono`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`milliseconds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`option-b-—-polling`,children:`Option B — Polling`}),`\n`,_jsx(_components.p,{children:`Useful if you prefer not to use callbacks.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Instant check`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`processor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` ProcessorState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::kReady) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* ... */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Drain all queued state changes (non-blocking)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ProcessorStateChange change;`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`processor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetNextStateChange`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(change))`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handle`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`change`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`change`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reason`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Block until the next change (use a dedicated monitor thread)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`processor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`WaitForStateChange`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(change,`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /*timeoutMs=*/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* ... */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(Warning,{children:[`Do not call `,_jsx(_components.code,{children:`WaitForStateChange`}),` from your audio thread. Use a dedicated monitor thread or the callback approach instead.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Processor State Handling","description":"Wait for kReady before sending audio — via callback or polling","icon":"signal","href":"/API-Reference/Cpp-SDK/Guides/Processor-States","hidden":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"States","slug":"states","depth":2,"children":[]},{"title":"Option A — State callback (recommended)","slug":"option-a-—-state-callback-recommended","depth":2,"children":[]},{"title":"Option B — Polling","slug":"option-b-—-polling","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"sanasai","siteName":"Sanas Developer Hub","title":"Processor State Handling - Sanas Developer Hub","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-16T20:39:24.362Z","originalFileLocation":"API-Reference/Cpp-SDK/Guides/Processor-States.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Wait for kReady before sending audio — via callback or polling\">\u003cmeta data-mint-head name=\"application-name\" content=\"Sanas Developer Hub\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"noindex\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Processor State Handling - Sanas Developer Hub\">\u003cmeta data-mint-head property=\"og:description\" content=\"Wait for kReady before sending audio — via callback or polling\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Sanas Developer Hub\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://sanasai.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Processor+State+Handling\u0026amp;description=Wait+for+kReady+before+sending+audio+%E2%80%94+via+callback+or+polling\u0026amp;theme=691bc464c5b101315ef6eb18\u0026amp;signature=13c8ca5ad1737576b42e827e6a45241d9b21e7b72768751196ac5811379890b1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Processor State Handling - Sanas Developer Hub\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Wait for kReady before sending audio — via callback or polling\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://sanasai.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Processor+State+Handling\u0026amp;description=Wait+for+kReady+before+sending+audio+%E2%80%94+via+callback+or+polling\u0026amp;theme=691bc464c5b101315ef6eb18\u0026amp;signature=13c8ca5ad1737576b42e827e6a45241d9b21e7b72768751196ac5811379890b1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/sanasai/A4EjLqcP-LGMXz5T/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Sanas Developer Hub\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#35CC88\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/API-Reference/Cpp-SDK/Guides/Processor-States.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developer.sanas.ai/#organization\",\"name\":\"Sanas Developer Hub\",\"url\":\"https://developer.sanas.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sanasai/ee_zurYLRvrMIUlJ/images/Sanaslogolight.svg?fit=max\u0026auto=format\u0026n=ee_zurYLRvrMIUlJ\u0026q=85\u0026s=13a3edb3ffab3c1a310d1ac462065cf8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developer.sanas.ai#website\",\"name\":\"Sanas Developer Hub\",\"url\":\"https://developer.sanas.ai\",\"publisher\":{\"@id\":\"https://developer.sanas.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States#webpage\",\"url\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States\",\"name\":\"Processor State Handling\",\"description\":\"Wait for kReady before sending audio — via callback or polling\",\"dateModified\":\"2026-07-16T20:39:24.362Z\",\"isPartOf\":{\"@id\":\"https://developer.sanas.ai#website\"},\"breadcrumb\":{\"@id\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"C++ SDK\",\"item\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Guides\",\"item\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Installation\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Processor State Handling\",\"item\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States#article\",\"headline\":\"Processor State Handling\",\"name\":\"Processor State Handling\",\"description\":\"Wait for kReady before sending audio — via callback or polling\",\"url\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States\",\"mainEntityOfPage\":{\"@id\":\"https://developer.sanas.ai/API-Reference/Cpp-SDK/Guides/Processor-States#webpage\"},\"dateModified\":\"2026-07-16T20:39:24.362Z\",\"publisher\":{\"@id\":\"https://developer.sanas.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://developer.sanas.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Sanas Developer Hub\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Sanas Developer Hub\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/API-Reference/Cpp-SDK/Guides/Processor-States.md","siteName":"Sanas Developer Hub","nav":{"global":null,"tabs":[{"tab":"Docs","icon":"books","pages":[{"title":"Docs","href":"/Docs/Getting-Started/Overview"}]},{"tab":"API Reference","icon":"gear-complex-api","hidden":true,"groups":[{"group":"Python SDK","icon":"python","pages":[{"title":"Overview","description":"Full API documentation for the Sanas SDK","icon":"house","href":"/API-Reference/Overview"},{"group":"Reference","icon":"book","pages":[{"group":"Core Classes","pages":[{"title":"RemoteSDK","description":null,"href":"/API-Reference/Reference/Core-Classes/RemoteSDK"},{"title":"AudioProcessor","description":null,"href":"/API-Reference/Reference/Core-Classes/AudioProcessor"}]},{"group":"Parameters","pages":[{"title":"InitParams","description":null,"href":"/API-Reference/Reference/Parameters/InitParams"},{"title":"AudioParams","description":null,"href":"/API-Reference/Reference/Parameters/AudioParams"}]},{"group":"Result Enums","pages":[{"title":"InitSDKResult","description":null,"href":"/API-Reference/Reference/Result-Enums/InitSDKResult"},{"title":"CreateProcessorResult","description":null,"href":"/API-Reference/Reference/Result-Enums/CreateProcessorResult"},{"title":"DestroyProcessorResult","description":null,"href":"/API-Reference/Reference/Result-Enums/DestroyProcessorResult"},{"title":"ShutdownSDKResult","description":null,"href":"/API-Reference/Reference/Result-Enums/ShutdownSDKResult"}]},{"group":"State Enums","pages":[{"title":"ProcessorState","description":null,"href":"/API-Reference/Reference/State-Enums/ProcessorState"}]},{"title":"State Callbacks","description":null,"href":"/API-Reference/Reference/State-Callbacks"}]}]},{"group":"C++ SDK","icon":"code","pages":[{"title":"C++ SDK Overview","description":"Real-time access to the Sanas cloud speech platform from a C++17 application","icon":"book","href":"/API-Reference/Cpp-SDK/Overview"},{"group":"Guides","icon":"book-open","pages":[{"title":"Installation \u0026 Linking","description":"Install, compile, and link the Sanas Speech AI SDK, then authenticate with your API key","icon":"download","href":"/API-Reference/Cpp-SDK/Guides/Installation"},{"title":"API Lifecycle","description":"The six-step sequence every SDK integration follows","icon":"arrows-rotate","href":"/API-Reference/Cpp-SDK/Guides/API-Lifecycle"},{"title":"Quick Start — Language Translation","description":"A complete, end-to-end C++ Language Translation program","icon":"rocket","href":"/API-Reference/Cpp-SDK/Guides/Quick-Start"},{"title":"Audio Format \u0026 Sending Audio","description":"Input requirements, real-time pacing, and PCM conversion for ProcessSamples","icon":"waveform","href":"/API-Reference/Cpp-SDK/Guides/Audio-Format"},{"title":"Processor State Handling","icon":"signal","href":"/API-Reference/Cpp-SDK/Guides/Processor-States"},{"title":"Transcripts","description":"Handle source and target transcript events delivered as JSON via callback","icon":"closed-captioning","href":"/API-Reference/Cpp-SDK/Guides/Transcripts"},{"title":"Language Translation","description":"Create a translation processor, choose languages, auto-detect, and switch languages live","icon":"language","href":"/API-Reference/Cpp-SDK/Guides/Language-Translation"},{"title":"Threading \u0026 Lifetime Rules","description":"Thread-safety, callback constraints, and object lifetime for the SDK","icon":"list-check","href":"/API-Reference/Cpp-SDK/Guides/Threading-and-Lifetime"},{"title":"Troubleshooting \u0026 Support","description":"Common symptoms and fixes, plus support resources","icon":"wrench","href":"/API-Reference/Cpp-SDK/Guides/Troubleshooting"}]},{"group":"Reference","icon":"book","pages":[{"title":"Core Classes","description":"IRemoteSDK and IAudioProcessor — the two interfaces your application uses","icon":"cube","href":"/API-Reference/Cpp-SDK/Reference/Core-Classes"},{"title":"Configuration Reference","description":"InitParams, AudioParams, LanguageConfig, and JitterParams","icon":"sliders","href":"/API-Reference/Cpp-SDK/Reference/Configuration"},{"title":"Result Codes","description":"Return-value enums for Initialize, CreateAudioProcessor, UpdateLanguageConfig, and cleanup","icon":"list-ol","href":"/API-Reference/Cpp-SDK/Reference/Result-Codes"},{"title":"State Enum \u0026 Callbacks","description":"ProcessorState, ProcessorStateChange, and the state/transcript callback signatures","icon":"bell","href":"/API-Reference/Cpp-SDK/Reference/State-and-Callbacks"}]},{"title":"Glossary","description":"Definitions of Sanas Speech AI SDK terms and concepts","icon":"book-bookmark","href":"/API-Reference/Cpp-SDK/Glossary"}]}]}]},"basePath":"","title":"Processor State Handling - Sanas Developer Hub","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}