-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
broken voice message spectrogram #354
Comments
This is expected behavior for voice messages bigger than 1 MB, for which waveform can't be generated server-side. As documented, such voice messages can't be uploaded by URL at all, and if uploaded as file they have only properties passed during the upload. |
I’m new to this so if you could elaborate a bit and tell me why the waveform is okay when I upload the same file from recorder app on my phone?
I did an experiment. I took the same mp3 file. Converted it to m4a and saved in my recordings in the recorder app on iOS. Then from that app I shared that m4a audio to a chat in telegram and after uploading the file was perfectly fine with a proper waveform and such.
Is there a way I could handle waveforms the other way so that in the end I get a nice audio with all the spectrograms in all the right places?
waveform can't be generated server-side
but how then the forms are generated when you save this audio locally? After downloading they refresh somehow.
|
The waveform is generated by the app, which uploads the file. Bot API doesn't support bot-side waveform generation. By the way, waveform is useless and irrelevant for long files anyway, because it shows samples from too distant points. |
Still I care for aesthetic reasons. I think it's better than a dead man's pulse. So I have to generate waveforms from my app and then send it with stream to bot chat, is that right? |
If the file was uploaded by some other means with a waveform, then it can be sent by the bot via file_id with the same waveform. |
Well, I've tried sending the m4a from recorder as a voice with the bot, the result is the same. What means can I use to upload files differently from Stream to preserve waveforms? An example at least. |
Waveforms for voice messages bigger than 1 MB are added by the app, which uploads the file. There is no way to add a waveform through Bot API. |
okay, got it. |
broken voice message spectrogram
Steps to reproduce
Just try sending any voice message (.ogg file, opus encoder) with sendVoiceAsync() that is longer than 10-15 minutes
await using Stream stream = System.IO.File.OpenRead(@"C:\Users\magrega\YandexDisk\проги\audio.ogg"); await client.SendVoiceAsync( chatId: message.Chat.Id, voice: new InputOnlineFile(stream), duration: 1097);
Expected behavior
Voice is sent as any other voice message with actual soundwaves
Actual behavior
sound spectrogram is flat
Screenshots
Additional info
The voice message works properly except for the broken spectrogram. If clicked with right mouse key and Saved as, then after downloading the audio spectrogram refreshes and is visible. How to refresh it on upload to a chat?
Environment data
NuGet Package Version: 18.0.0
.NET Version: .NET 6.0
IDE: VS2022
App: iOS, Win10
The text was updated successfully, but these errors were encountered: