java.lang.Object
it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage<AudioMessage>
it.auties.whatsapp.model.message.standard.AudioMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,MutableAttachmentProvider<AudioMessage>,ContextualMessage<AudioMessage>,MediaMessage<AudioMessage>,Message
public final class AudioMessage
extends it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage<AudioMessage>
implements MediaMessage<AudioMessage>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAudioMessage(String mediaUrl, String mimetype, byte[] mediaSha256, Long mediaSize, Integer duration, boolean voiceMessage, byte[] mediaKey, byte[] mediaEncryptedSha256, String mediaDirectPath, Long mediaKeyTimestampSeconds, ContextInfo contextInfo, byte[] streamingSidecar, byte[] waveform, Integer backgroundArgb) -
Method Summary
Modifier and TypeMethodDescriptionReturns the type of this attachment(package private) static AudioMessagecustomBuilder(byte[] media, ContextInfo contextInfo, String mimeType, boolean voiceMessage) duration()private static StringgetMimeType(byte[] media, String mimeType) Returns the direct path to the mediaOptional<byte[]> Returns the sha256 of this encrypted mediaOptional<byte[]> mediaKey()Returns the key of this mediaReturns the timestampSeconds forMutableAttachmentProvider.mediaKey()Returns the timestampSeconds, that is the seconds elapsed sinceInstant.EPOCH, forMutableAttachmentProvider.mediaKey()Optional<byte[]> Returns the sha256 of this mediaReturns the size of this mediaReturns the media type of the media that this object wrapsmediaUrl()Returns the url to the mediamimetype()setContextInfo(ContextInfo contextInfo) setMediaDirectPath(String mediaDirectPath) Sets the direct path of this providersetMediaEncryptedSha256(byte[] bytes) Sets the sha256 of the encrypted media in this providersetMediaKey(byte[] bytes) Sets the media key of this providersetMediaKeyTimestamp(Long timestamp) Sets the timestamp of the media keysetMediaSha256(byte[] bytes) Sets the sha256 of the media in this providersetMediaSize(long mediaSize) Sets the size of this mediasetMediaUrl(String mediaUrl) Sets the media url of this providerOptional<byte[]> booleanOptional<byte[]> waveform()Methods inherited from class it.auties.whatsapp.model.message.model.reserved.ExtendedMediaMessage
decodedMedia, handle, setDecodedMedia, setHandleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.auties.whatsapp.model.message.model.MediaMessage
category, type
-
Field Details
-
mediaUrl
-
mimetype
-
mediaSha256
private byte[] mediaSha256 -
mediaSize
-
duration
-
voiceMessage
private final boolean voiceMessage -
mediaKey
private byte[] mediaKey -
mediaEncryptedSha256
private byte[] mediaEncryptedSha256 -
mediaDirectPath
-
mediaKeyTimestampSeconds
-
contextInfo
-
streamingSidecar
private final byte[] streamingSidecar -
waveform
private final byte[] waveform -
backgroundArgb
-
-
Constructor Details
-
AudioMessage
public AudioMessage(String mediaUrl, String mimetype, byte[] mediaSha256, Long mediaSize, Integer duration, boolean voiceMessage, byte[] mediaKey, byte[] mediaEncryptedSha256, String mediaDirectPath, Long mediaKeyTimestampSeconds, ContextInfo contextInfo, byte[] streamingSidecar, byte[] waveform, Integer backgroundArgb)
-
-
Method Details
-
customBuilder
static AudioMessage customBuilder(byte[] media, ContextInfo contextInfo, String mimeType, boolean voiceMessage) -
getMimeType
-
mimetype
-
duration
-
voiceMessage
public boolean voiceMessage() -
streamingSidecar
-
waveform
-
backgroundArgb
-
mediaUrl
Description copied from interface:MutableAttachmentProviderReturns the url to the media- Specified by:
mediaUrlin interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a nullable String
-
setMediaUrl
Description copied from interface:MutableAttachmentProviderSets the media url of this provider- Specified by:
setMediaUrlin interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- the same provider
-
mediaDirectPath
Description copied from interface:MutableAttachmentProviderReturns the direct path to the media- Specified by:
mediaDirectPathin interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a nullable String
-
setMediaDirectPath
Description copied from interface:MutableAttachmentProviderSets the direct path of this provider- Specified by:
setMediaDirectPathin interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- the same provider
-
mediaKey
Description copied from interface:MutableAttachmentProviderReturns the key of this media- Specified by:
mediaKeyin interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a non-null array of bytes
-
setMediaKey
Description copied from interface:MutableAttachmentProviderSets the media key of this provider- Specified by:
setMediaKeyin interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- the same provider
-
setMediaKeyTimestamp
Description copied from interface:MutableAttachmentProviderSets the timestamp of the media key- Specified by:
setMediaKeyTimestampin interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- the same provider
-
mediaSha256
Description copied from interface:MutableAttachmentProviderReturns the sha256 of this media- Specified by:
mediaSha256in interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a non-null array of bytes
-
setMediaSha256
Description copied from interface:MutableAttachmentProviderSets the sha256 of the media in this provider- Specified by:
setMediaSha256in interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- the same provider
-
mediaEncryptedSha256
Description copied from interface:MutableAttachmentProviderReturns the sha256 of this encrypted media- Specified by:
mediaEncryptedSha256in interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a non-null array of bytes
-
setMediaEncryptedSha256
Description copied from interface:MutableAttachmentProviderSets the sha256 of the encrypted media in this provider- Specified by:
setMediaEncryptedSha256in interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- the same provider
-
mediaSize
Description copied from interface:MutableAttachmentProviderReturns the size of this media- Specified by:
mediaSizein interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a long
-
mediaKeyTimestampSeconds
Description copied from interface:MediaMessageReturns the timestampSeconds, that is the seconds elapsed sinceInstant.EPOCH, forMutableAttachmentProvider.mediaKey()- Specified by:
mediaKeyTimestampSecondsin interfaceMediaMessage<AudioMessage>- Returns:
- an unsigned long
-
mediaKeyTimestamp
Description copied from interface:MediaMessageReturns the timestampSeconds forMutableAttachmentProvider.mediaKey()- Specified by:
mediaKeyTimestampin interfaceMediaMessage<AudioMessage>- Returns:
- a zoned date time
-
setMediaSize
Description copied from interface:MutableAttachmentProviderSets the size of this media- Specified by:
setMediaSizein interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a long
-
attachmentType
Description copied from interface:MutableAttachmentProviderReturns the type of this attachment- Specified by:
attachmentTypein interfaceMediaMessage<AudioMessage>- Specified by:
attachmentTypein interfaceMutableAttachmentProvider<AudioMessage>- Returns:
- a non-null attachment
-
contextInfo
- Specified by:
contextInfoin interfaceContextualMessage<AudioMessage>
-
setContextInfo
- Specified by:
setContextInfoin interfaceContextualMessage<AudioMessage>
-
mediaType
Description copied from interface:MediaMessageReturns the media type of the media that this object wraps- Specified by:
mediaTypein interfaceMediaMessage<AudioMessage>- Returns:
- a non-null
MediaMessageType
-