<p>A notification sound file may be uploaded using <ahref="/method/account.uploadRingtone">account.uploadRingtone</a>.<br>
After upload, the document should be provided to <ahref="/method/account.saveRingtone">account.saveRingtone</a> to save the notification sound, returning a simple <ahref="/constructor/account.savedRingtone">account.savedRingtone</a>. </p>
<p>Supported formats:</p>
<ul>
<li>MP3</li>
<li>OGG OPUS</li>
</ul>
<p>An existing voice message may also be passed directly to <ahref="/method/account.saveRingtone">account.saveRingtone</a>.<br>
When passing existing voice messages to <ahref="/method/account.saveRingtone">account.saveRingtone</a> an <ahref="/constructor/account.savedRingtoneConverted">account.savedRingtoneConverted</a> constructor will be returned containing the new document to use <strong>instead of</strong> the original voice message document when <ahref="#removing-notification-sounds">removing</a> or <ahref="#setting-notification-sounds">using</a> notification sounds. </p>
<p>The following ringtone limits are specified in the <ahref="/api/config#client-configuration">client configuration</a>:</p>
<ul>
<li><ahref="/api/config#ringtone-duration-max">ringtone_duration_max</a> - The maximum duration in seconds of uploaded ringtones</li>
<li><ahref="/api/config#ringtone-saved-count-max">ringtone_saved_count_max</a> - The maximum number of saveable ringtones</li>
<li><ahref="/api/config#ringtone-size-max">ringtone_size_max</a> - The maximum (post-conversion) filesize in bytes of uploadable ringtones</li>
<p><ahref="/method/account.getSavedRingtones">account.getSavedRingtones</a> can be used to obtain all saved notification sounds.<br>
The client will receive an <ahref="/constructor/updateSavedRingtones">updateSavedRingtones</a> update if the list is modified by the user on other clients, which should trigger a call to <ahref="/method/account.getSavedRingtones">account.getSavedRingtones</a>. </p>
<p>To set the notification sound to play when receiving messages from a specific peer or from a category of peers, use <ahref="/method/account.updateNotifySettings">account.updateNotifySettings</a>, populating the <code>ios_sound</code>, <code>android_sound</code> or <code>other_sound</code> fields according to the platform where the sound should be played. </p>
<p>The fields can be populated with the following constructors:</p>
<ul>
<li><ahref="/constructor/notificationSoundDefault">notificationSoundDefault</a> - The default notification sound should be played</li>
<li><ahref="/constructor/notificationSoundNone">notificationSoundNone</a> - No notification sound should be played</li>
<li><ahref="/constructor/notificationSoundRingtone">notificationSoundRingtone</a> - A previously <ahref="#uploading-notification-sounds">uploaded</a> notification sound identified by the uploaded/converted document <code>id</code> should be played.</li>
<li><ahref="/constructor/notificationSoundLocal">notificationSoundLocal</a> - A local notification sound (possibly provided by the OS) identified by the client-specific <code>data</code> payload should be played.</li>
</ul></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.