Documentation
¶
Overview ¶
Command android-audio is a development example (step 31.6): a Material page that plays a 440 Hz tone through the public audio package and, besides, through a device of the platform's own (to read the AAudio stream's timestamp, which the public package does not show), and logs what the audio does twice a second. The device tests start it on the emulator and check that the callbacks run, that the timestamps advance, that the stream pauses when the app is hidden and goes on when it is shown, and that a recording asks for the permission. It may use internal packages, and runs where there is an audio service (the stats are for Android only).
The log lines (the default logger's, so "INFO " comes first):
audio state state=<running|paused|lost|closed> audio stats public=<frames played by the public device> platform=<fills of the platform's device> frame=<n> nanos=<n> ts=<bool> ... audio capture failed err=<tag> audio capture frames=<n>
GLUTTER_AUDIO_CAPTURE=1 also opens a recording device. Run it on a device or the emulator with:
go run ./cmd/glutter-android run -permission android.permission.RECORD_AUDIO ./examples/dev/android-audio