Notification.ExtraAudioContentsUri Field

Definition

#extras key: the audio contents of this notification.

[Android.Runtime.Register("EXTRA_AUDIO_CONTENTS_URI", ApiSince=26)]
public const string ExtraAudioContentsUri;
[<Android.Runtime.Register("EXTRA_AUDIO_CONTENTS_URI", ApiSince=26)>]
val mutable ExtraAudioContentsUri : string

Field Value

Implements

Attributes

Remarks

#extras key: the audio contents of this notification.

This is for use when rendering the notification on an audio-focused interface; the audio contents are a complete sound sample that contains the contents/body of the notification. This may be used in substitute of a Text-to-Speech reading of the notification. For example if the notification represents a voice message this should point to the audio of that message.

The data stored under this key should be a String representation of a Uri that contains the audio contents in one of the following formats: WAV, PCM 16-bit, AMR-WB.

This extra is unnecessary if you are using MessagingStyle since each Message has a field for holding data URI. That field can be used for audio. See Message#setData.

Example usage:

{@code
            Notification.Builder myBuilder = (build your Notification as normal);
            myBuilder.getExtras().putString(EXTRA_AUDIO_CONTENTS_URI, myAudioUri.toString());
            }

Java documentation for android.app.Notification.EXTRA_AUDIO_CONTENTS_URI.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to