Microphone recording.
Requires :microphone permission (request via Mob.Permissions.request/2).
Usage:
Mob.Audio.start_recording(socket, format: :aac, quality: :medium)
# ... user records ...
Mob.Audio.stop_recording(socket)Result arrives as:
handle_info({:audio, :recorded, %{path: path, duration: seconds}}, socket)
handle_info({:audio, :error, reason}, socket)iOS: AVAudioRecorder. Android: MediaRecorder.
Summary
Functions
Start recording audio from the microphone.
Stop the in-progress recording and save it to a temp file.
Result arrives as {:audio, :recorded, %{path: ..., duration: ...}}.
Types
Functions
@spec start_recording( Mob.Socket.t(), keyword() ) :: Mob.Socket.t()
Start recording audio from the microphone.
Options:
format: :aac | :wav(default:aac)quality: :low | :medium | :high(default:medium)
@spec stop_recording(Mob.Socket.t()) :: Mob.Socket.t()
Stop the in-progress recording and save it to a temp file.
Result arrives as {:audio, :recorded, %{path: ..., duration: ...}}.