Skip to main content

qualia_core_db/audio/
audio_sidecar_link.rs

1//! Current native QAC production facade and explicit resource-registry linkage.
2//! Actual PCM/current typed documents determine full-byte artifact identity.
3//! Tensor previews are display data and are never synthesized into original PCM.
4use crate::tensor::bake_pipeline::{audio_sidecar_relpath, PRED_HAS_SPECTRAL_SHEET};
5use crate::NQuin;
6
7#[cfg(not(target_arch = "wasm32"))]
8pub use crate::audio::qac::production::{
9    produce_pcm, publish_current_signal, Error as SidecarPublishError, ProductionOptions,
10};
11
12/// Link a caller-assigned resource-registry index. It is deliberately separate
13/// from the full32-byte content digest and is never derived from a preview/hash.
14#[inline]
15pub fn compile_spectral_sheet_quin(subject_hash: u64, sheet_index: u32) -> NQuin {
16    let mut q = NQuin::default();
17    q.subject = subject_hash;
18    q.predicate = PRED_HAS_SPECTRAL_SHEET;
19    q.object = u64::from(sheet_index);
20    q
21}
22/// Format the entire final-byte digest into a canonical .qac relative path.
23/// A short buffer returns0 without changing caller bytes.
24#[inline]
25pub fn format_sidecar_relpath(digest: &[u8; 32], out: &mut [u8]) -> usize {
26    audio_sidecar_relpath(digest, out)
27}
28
29#[cfg(test)]
30#[path = "audio_sidecar_link_tests.rs"]
31mod tests;