This class is deprecated.
Nearby Messages will no longer support audio.
A message that will be sent directly over near-ultrasound audio. The payload can be an
arbitrary byte[] array limited in size as given byMAX_SIZE
.
Use this in combination with theMessages
API to send or receive data over audio. For instance, the
toMessage()
method can be used to fetch a NearbyMessage
object for a
Messages.publish(GoogleApiClient, Message)
call.
Similarly, the
from(Message)
method can be used to convert a Message obtained from a subscribe
call to an AudioBytes object.
Constant Summary
int | MAX_SIZE | The maximum size of the audio message payload. |
Public Constructor Summary
AudioBytes(byte[] audioData)
Creates an AudioBytes object from a byte[] payload for use with the Nearby
Messages API.
|
Public Method Summary
staticAudioBytes |
from(Message
message)
Converts a Message of type
Message.MESSAGE_TYPE_AUDIO_BYTES to an AudioBytes object.
|
byte[] |
getBytes()
Returns the byte array payload.
|
Message |
toMessage()
Obtain a
Message
object for use with the
Messages.publish(GoogleApiClient, Message) call.
|
String |
toString()
|
Inherited Method Summary
Constants
public static final int MAX_SIZE
The maximum size of the audio message payload. Only
MAX_SIZE
bytes will be sent over the audio medium.
Public Constructors
publicAudioBytes(byte[] audioData)
Creates an AudioBytes object from a byte[] payload for use with the Nearby Messages API.
Public Methods
public staticAudioBytes from(Message message)
Converts a Message of type
Message.MESSAGE_TYPE_AUDIO_BYTES
to an AudioBytes object.
Parameters
message | InputMessage
object. |
---|
Returns
- Instance of a corresponding
AudioBytes
object.
public byte[]getBytes()
Returns the byte array payload.
publicMessage toMessage()
Obtain aMessage
object for use with the
Messages.publish(GoogleApiClient, Message)
call.
Returns
Message
object.