tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.13k stars 1.45k forks source link

When send voicenote with own client official desktop telegram shows it strange #2850

Closed unityatadev closed 6 months ago

unityatadev commented 6 months ago

Do you have example to send voicenote ?(voice message) Im trying to send it like this with own client : _: 'inputMessageVoiceNote', voice_note: { _: 'inputFileLocal', path: this.path, mime_type:'audio/ogg' }, duration:2, waveform:null, caption:null here type is inputMessageVoiceNote . But here something strange happening . On Telegram Desktop, the first time I saw the voice message , I can play it . After the first launch, it became like this еуеу icon changed and i cant replay it . When I click it it opens audio in mediaplayer in pc . On phone all is good I can replay it .

Why I think that it because of code ? When I send voice message with official tg client I can get normal voice message in tg desktop I can replay it.

levlam commented 6 months ago

You need to get the message with TDLib and check its content. If it is messageVoiceNote and all other fields look correct, then it is likely to be a Telegram Desktop issue.

unityatadev commented 6 months ago

{ "_": "message", "author_signature": "", "auto_delete_in": 0, "can_be_deleted_for_all_users": true, "can_be_deleted_only_for_self": false, "can_be_edited": false, "can_be_forwarded": true, "can_be_saved": true, "can_get_added_reactions": false, "can_get_media_timestamp_links": false, "can_get_message_thread": false, "can_get_statistics": false, "can_get_viewers": false, "can_report_reactions": false, "chat_id": 354453141, "contains_unread_mention": false, "content": { "_": "messageVoiceNote", "caption": { "_": "formattedText", "entities": [], "text": "" }, "is_listened": false, "voice_note": { "_": "voiceNote", "duration": 2, "mime_type": "audio/ogg", "voice": { "_": "file", "expected_size": 41848, "id": 1327, "local": { "_": "localFile", "can_be_deleted": false, "can_be_downloaded": false, "download_offset": 0, "downloaded_prefix_size": 41848, "downloaded_size": 41848, "is_downloading_active": false, "is_downloading_completed": true, "path": "/var/www/blank/test/files/client_id1/chat_id354453141/587e2f0e-6335-4b47-999e-f4c0a5f133d6/voice.ogg" }, "remote": { "_": "remoteFile", "id": "", "is_uploading_active": true, "is_uploading_completed": false, "unique_id": "", "uploaded_size": 0 }, "size": 41848 }, "waveform": "AAAAAAABABACACCAEAIAIIAwzEEIoaQSQgghhM4xppRSCiFjjCGGGEIIIYIQIYQQAggAABBCACCAAIAIIQQA" } }, "date": 1713336646, "edit_date": 0, "has_timestamped_media": true, "id": 39915094017, "is_channel_post": false, "is_outgoing": true, "is_pinned": false, "is_topic_message": false, "level": "info", "media_album_id": "0", "message_thread_id": 0, "restriction_reason": "", "self_destruct_in": 0, "sender_id": { "_": "messageSenderUser", "user_id": 5606345408 }, "sending_state": { "_": "messageSendingStatePending", "sending_id": 0 }, "unread_reactions": [], "via_bot_user_id": 0 } here its updatenewmessage

levlam commented 6 months ago

This is irrelevant because "sending_state": { "_": "messageSendingStatePending", "sending_id": 0 },. You need to check information about the message after it was sent.

unityatadev commented 6 months ago

{"_":"updateMessageSendSucceeded","level":"error","message":{"_":"message","author_signature":"","auto_delete_in":0,"can_be_deleted_for_all_users":true,"can_be_deleted_only_for_self":true,"can_be_edited":true,"can_be_forwarded":true,"can_be_saved":true,"can_get_added_reactions":false,"can_get_media_timestamp_links":false,"can_get_message_thread":false,"can_get_statistics":false,"can_get_viewers":false,"can_report_reactions":false,"chat_id":6426572438,"contains_unread_mention":false,"content":{"_":"messageVoiceNote","caption":{"_":"formattedText","entities":[],"text":""},"is_listened":false,"voice_note":{"_":"voiceNote","duration":2,"mime_type":"audio/ogg","voice":{"_":"file","expected_size":72094,"id":1339,"local":{"_":"localFile","can_be_deleted":false,"can_be_downloaded":true,"download_offset":0,"downloaded_prefix_size":72094,"downloaded_size":72094,"is_downloading_active":false,"is_downloading_completed":true,"path":"/var/www/blank/testdev/files/client_id1/chat_id6426572438/8bfb7813-d9b9-40be-a780-7fbbb6a098f9/voice.ogg"},"remote":{"_":"remoteFile","id":"AwACAgIAAxkDAAKVeGYfrYq6yqIvMQjStzkQfEbRKO5qAAJDRwACjZwAAUnYHzRj4csGijAE","is_uploading_active":false,"is_uploading_completed":true,"unique_id":"AgADQ0cAAo2cAAFJ","uploaded_size":72094},"size":72094},"waveform":"AAAAAAABABACACCAEAIAIIAwzEEIoaQSQgghhM4xppRSCiFjjCGGGEIIIYIQIYQQAggAABBCACCAAIAIIQQA"}},"date":1713352074,"edit_date":0,"has_timestamped_media":true,"id":40122712064,"is_channel_post":false,"is_outgoing":true,"is_pinned":false,"is_topic_message":false,"media_album_id":"0","message_thread_id":0,"restriction_reason":"","self_destruct_in":0,"sender_id":{"_":"messageSenderUser","user_id":5606345408},"unread_reactions":[],"via_bot_user_id":0},"old_message_id":40109080577} Here success update

levlam commented 6 months ago

This is an ordinary voice note message, so it is likely to be a Telegram Desktop issue.

unityatadev commented 6 months ago

but here something strange . I have in my crm function which is convert text to voice (i can chose voice. its third party service) and also send this voice same like voicenote . Here its success update {"_":"updateMessageSendSucceeded","level":"error","message":{"_":"message","author_signature":"","auto_delete_in":0,"can_be_deleted_for_all_users":true,"can_be_deleted_only_for_self":true,"can_be_edited":true,"can_be_forwarded":true,"can_be_saved":true,"can_get_added_reactions":false,"can_get_media_timestamp_links":false,"can_get_message_thread":false,"can_get_statistics":false,"can_get_viewers":false,"can_report_reactions":false,"chat_id":6426572438,"contains_unread_mention":false,"content":{"_":"messageVoiceNote","caption":{"_":"formattedText","entities":[],"text":""},"is_listened":false,"voice_note":{"_":"voiceNote","duration":1,"mime_type":"audio/mpeg","voice":{"_":"file","expected_size":21315,"id":1336,"local":{"_":"localFile","can_be_deleted":false,"can_be_downloaded":true,"download_offset":0,"downloaded_prefix_size":21315,"downloaded_size":21315,"is_downloading_active":false,"is_downloading_completed":true,"path":"/var/www/blank/testdevbackumnico/files/client_id1/chat_id6426572438/84644983-7943-4cf7-ad8f-6e22c4c9c967/test.mp3"},"remote":{"_":"remoteFile","id":"AwACAgIAAxkDAAKVrWYfutH0TRXS77pT2fuLfmKLzzNtAAIjSAACjZwAAUlPDHinm_XjCzAE","is_uploading_active":false,"is_uploading_completed":true,"unique_id":"AgADI0gAAo2cAAFJ","uploaded_size":21315},"size":21315},"waveform":""}},"date":1713355473,"edit_date":0,"has_timestamped_media":true,"id":40178286592,"is_channel_post":false,"is_outgoing":true,"is_pinned":false,"is_topic_message":false,"media_album_id":"0","message_thread_id":0,"restriction_reason":"","self_destruct_in":0,"sender_id":{"_":"messageSenderUser","user_id":5606345408},"unread_reactions":[],"via_bot_user_id":0},"old_message_id":40168849409} What is stange that it working correct . I can replay it in tg desktop like usual voice message . Is it possible because of audio file ? text to voice audio file created in thirs party service and it shows but just voice not . But when I download and open both in pc both plays fine

levlam commented 6 months ago

I have no way to know, what can cause such behavior in Telegram Desktop.

unityatadev commented 6 months ago

I have no way to know, what can cause such behavior in Telegram Desktop.

Thank you a lot man . You anyway helped me analyze problem and find where problem . I solved it . I changed library and using ffmpeg now and dont have this problem . Problem was because of file . I dont know why and how this affected to tg desktop ,but now it works.