# TdApi.VoiceNote (tdlight API 3.3.160 API)
declaration: package: it.tdlight.jni, class: TdApi, class: VoiceNote

Package it.tdlight.jni

# Class TdApi.VoiceNote

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.VoiceNote

Enclosing class:
  TdApi

    public static class TdApi.VoiceNote
    extends TdApi.Object

Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel.

## Field Summary

Fields
Modifier and Type | Field | Description
--- | --- | ---
`static int` | `CONSTRUCTOR` |
`int` | `duration` | Duration of the voice note, in seconds; as defined by the sender.
`String` | `mimeType` | MIME type of the file; as defined by the sender.
`TdApi.File` | `voice` | File containing the voice note.
`byte[]` | `waveform` | A waveform representation of the voice note in 5-bit format.

## Constructor Summary

Constructors
Constructor | Description
--- | ---
`VoiceNote()` | Describes a voice note.
`VoiceNote​(int duration, byte[] waveform, String mimeType, TdApi.File voice)` | Describes a voice note.
`VoiceNote​(DataInput input)` |

## Method Summary

Modifier and Type | Method | Description
--- | --- | ---
`boolean` | `equals​(Object o)` |
`int` | `getConstructor()` |
`int` | `hashCode()` |
`void` | `serialize​(DataOutput output)` |

### Methods inherited from class it.tdlight.jni.TdApi.Object

`serialize, toString`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### duration

public int duration
Duration of the voice note, in seconds; as defined by the sender.

### waveform

public byte[] waveform
A waveform representation of the voice note in 5-bit format.

### mimeType

public String mimeType
MIME type of the file; as defined by the sender.

### voice

public TdApi.File voice
File containing the voice note.

### CONSTRUCTOR

public static final int CONSTRUCTOR

See Also:
  Constant Field Values

## Constructor Details

### VoiceNote

public VoiceNote()
Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel.

### VoiceNote

public VoiceNote​(int duration, byte[] waveform, String mimeType, TdApi.File voice)
Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel.

Parameters:
  `duration` - int Duration of the voice note, in seconds; as defined by the sender.
  `waveform` - byte[] A waveform representation of the voice note in 5-bit format.
  `mimeType` - String MIME type of the file; as defined by the sender.
  `voice` - File File containing the voice note.

### VoiceNote

public VoiceNote​(DataInput input) throws IOException

Throws:
  `IOException`

## Method Details

### getConstructor

public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`

### serialize

public void serialize​(DataOutput output) throws IOException

Specified by:
  `serialize` in class `TdApi.Object`
Throws:
  `IOException`

### equals

public boolean equals​(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`