MobMedia.SelfTest (mob_media v0.1.0)

Copy Markdown View Source

The plugin's on-device proof (Mob.Plugin.SelfTest), run by mix mob.selftest and mob_ci for every activated plugin.

It writes a one-second 44.1 kHz stereo WAV of a 440 Hz tone, then through the NIF (MobMedia.Engine.Native):

  1. MobMedia.info/2 must report audio, no video, and a duration within 50 ms of 1000;
  2. MobMedia.audio_pcm/2 must decode it to 16 kHz mono: 32 000 bytes (within 50 ms) of audible signal. On Android that's MediaExtractor, a MediaCodec raw decoder and the bridge's downmix and resampler; on iOS AVAssetReader with LinearPCM output settings;
  3. MobMedia.frame/3 on it must answer {:error, :no_video}, which takes a real look at the file's tracks.

The WAV is deleted afterwards. There is no skip: no hardware, permission or network is involved, so every device and simulator gives the full answer.