Appearance
A voice message
A voice message recorded in the composer: the conversation's sendVoice({ file, waveform? }). The composer's voice mode first sends the three AI-voice queries (the subscription, the effects quota and the voice list), then uploads the take through VoiceAttachmentMessage and broadcasts voice_attachment with the take's waveform. The waveform is measured from the take's own bytes (@igpapi/ffmpeg-audio decoding it, twenty windows) — pass waveform to set the samples yourself.
The composer before a voice message: the microphone in the field.
The voice message shown in the conversation after sendVoice({ file }).
ts
import { AndroidIgpapi, FeedTimelineScreen } from '@igpapi/android';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';
// A checkpoint read back from your storage (see "Keep a session").
const saved = JSON.parse(await readFile('session.json', 'utf8'));
// Send a voice message: the composer's voice mode measures the take's waveform.
const take = await readFile('take.m4a');
const sent = await AndroidIgpapi.launch({
checkpoint: saved,
screen: FeedTimelineScreen,
main: feed =>
Effect.gen(function* () {
const tab = yield* feed.openDirectTab();
const item = tab.threads[0];
if (item === undefined) return undefined;
const thread = yield* item.open();
// The waveform is measured from the file; pass `waveform` to set the samples yourself.
return yield* thread.sendVoice({ file: take });
}),
});
console.log(sent);The legacy facade's voiceAttachment sends the same form as sendVoice: the fields are the app's voice attachment's, and no recording shows the facade's own chain, so a difference between the two entry points is unmeasured.