0.1.0
- C ABI
priv/include/mob_audio_io.h(ABI 1):mai_register,mai_unregister,mai_post,mai_abi_version,mai_now_ns;mai_processor(render, capture,stream_event(ctx, stream, event, time)) andmai_time(stream frame, host ns, presentation ns, rate, channels). iOS times are on mach_absolute_time's clock (the clock ofAudioTimeStamp.mHostTimeand mob_midi), Android's on CLOCK_MONOTONIC. - Presentation time per block: iOS from
mHostTimeplus the session's latency; Android 12+ from AAudio timestamps (polled off the audio thread), Android 8-11 estimated from the buffer, never callingAAudioStream_getTimestamp, which aborts there. MobAudioIo.open/3takes:module(the app's NIF module, loaded first),:channels,:input_channels,:preset,:device,:input_device; a failed open returns the platform's detail ({:error, {:unavailable, detail}}).status/0:cb_frames(the last callback's),cb_frames_min/max,input_latency_ms,present,input_underflows,in_peak_db,in_rms_db.- Posts still queued at close reach the owner before
:stopped, or are counted in:stopped'sposts_droppedwhen the owner has exited. - The event thread sleeps while no stream is open; failed reopens back off from 0.5 s to 8 s.
- iOS: an interruption that began while the app was suspended, or whose end never came, is recovered when the app returns to the foreground.
MobAudioIo.devices/1.MobAudioIo.decode_stream/3: a file decoded on a thread of its own and handed out in chunks as it decodes, to the owner ({:mob_audio_io, :decoded, id, binary}, at mostwindow:chunks unacknowledged:decode_ack/2) or to a registered processor'scaptureon the decode's thread (processor:), with:decode_startedand one end (:decode_done,:decode_cancelled,:decode_error);mono:,chunk_frames:,max_ms:(:too_long, at once from the file's stated length).decode_cancel/1stops it within one codec buffer and releases the codec; the owner's exit cancels it.decode/2collects one; the Fake runs both on WAV. CI decodes 5-minute WAV, M4A and MP3 files in chunks on macOS (memory bounded, cancel mid-file), through the real NIF too.MobAudioIo.SelfTestchecks output and, when the microphone is permitted, input.
- Android: AAudio input with presets (default, generic, performance,
unprocessed, voice) and device selection, duplex (input read as 16-bit in
the output callback through a ring),
RECORD_AUDIOcheck,devices/1throughAudioManager, file decoding throughAMediaCodec. - iOS: RemoteIO input (VoiceProcessingIO for
:voice), duplex in one unit, the session configured from all open streams, preferred input by port UID, microphone permission check,devices/1, file decoding through ExtAudioFile. - A stream lost within 1 s of each start backs off (0.5 s to 8 s) instead of reopening at once; an explicit Android device that disappears falls back to the system's route on reopen.
- Manifest:
RECORD_AUDIOandNSMicrophoneUsageDescription. - CI: the C core under ASan+UBSan and TSan; the Apple C parts against real CoreAudio on macOS.