sense-file/- file-mode: load a local audio file and run inference to completion (sense-file-app <audio_file>).sense-stream/- stream-mode: capture the microphone and infer in real time (sense-stream-app).
Prerequisites: a C++14 compiler, CMake >= 3.10, and the Cochl.Sense Edge SDK staged at ./sense (include/ + lib/).
cmake -B build
cmake --build buildThe binaries sense-file-app and sense-stream-app land in this directory, next to config.json and audio-files/, so you can run them in place.
Set your project key in kProjectKey (top of sense_file.cc / sense_stream.cc). A config.json in the working directory is used if present (missing is non-fatal).
./sense-file-app audio-files/babycry.wav # file mode (blocks until end of file)
./sense-stream-app # mic mode (Ctrl-C to stop)Each prints one JSON result per inference window (start_time, end_time, prediction_time_ms, tags); a summaries field is added when Result Summary is enabled.
config.json(optional) controls sensitivity, Result Summary, Audio Activity Detection, and Automatic Gain Control (AAD/AGC are stream-only); the same knobs are available at runtime viaprocessor->controls()afterBuild().- Callback: each tutorial's
ResultPrinter(asense::FrameResultListener) firesOnResultonce per window on the SDK's inference thread -- edit it or pass your own to.SetCallback(). - Capture spec (stream), at the top of
sense_stream.cc:kNumChannels,kFormat,kCaptureSampleRate(0= model rate; higher is downsampled),kHopSize.kFormatissense::SampleFormat::{kFloat32,kInt16,kInt32}; feed 24-bit audio askInt32, left-justified (sample << 8).sense-filereads its format from the file header. Microphone capture is tutorial-side (vendored miniaudio); the SDK has no audio-device dependency.