1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-12-14 20:46:56 +01:00
MadelineProto/docs/TD_docs/constructors/audio.md

51 lines
1.7 KiB
Markdown
Raw Normal View History

---
title: audio
description: Describes audio file. Audio is usually in mp3 format
---
## Constructor: audio
[Back to constructors index](index.md)
Describes audio file. Audio is usually in mp3 format
### Attributes:
| Name | Type | Required | Description |
|----------|:-------------:|:--------:|------------:|
|duration|[int](../types/int.md) | Yes|Duration of the audio in seconds as defined by sender|
|title|[string](../types/string.md) | Yes|Title of the audio as defined by sender|
|performer|[string](../types/string.md) | Yes|Performer of the audio as defined by sender|
|file\_name|[string](../types/string.md) | Yes|Original name of a file as defined by sender|
|mime\_type|[string](../types/string.md) | Yes|MIME type of a file as defined by sender|
|album\_cover\_thumb|[photoSize](../types/photoSize.md) | Yes|Thumb of the album's cover as defined by sender. Full size thumb should be extracted from the downloaded file, nullable|
|audio|[file](../types/file.md) | Yes|File with the audio|
### Type: [Audio](../types/Audio.md)
### Example:
```
$audio = ['_' => 'audio', 'duration' => int, 'title' => string, 'performer' => string, 'file_name' => string, 'mime_type' => string, 'album_cover_thumb' => photoSize, 'audio' => file, ];
```
2017-07-23 16:11:02 +02:00
[PWRTelegram](https://pwrtelegram.xyz) json-encoded version:
```
{"_":"audio","duration":"int","title":"string","performer":"string","file_name":"string","mime_type":"string","album_cover_thumb":"photoSize","audio":"file"}
```
Or, if you're into Lua:
```
audio={_='audio', duration=int, title=string, performer=string, file_name=string, mime_type=string, album_cover_thumb=photoSize, audio=file, }
```