S
S
sudo rm -rf /2021-02-27 16:08:15
In contact with
sudo rm -rf /, 2021-02-27 16:08:15

VK. Is it possible for the user to record an audio message from a file stream? How to implement?

I have a set of generated messages through a neuron (text-to-voice conversion).
VK does not want to attach them to the message, I do not want to upload them to the playlist.
At this point, I have a question. I can send a voice message through the browser. In principle, this is already enough for the implementation, I can start the message recording and turn on the desired entry. But this is clumsy and uninteresting.
It would be more interesting to do it directly. For example, create a stream through ffmpeg and somehow push it instead of the microphone audio stream. Or something like that. In the end, it was possible to write a simple userscript that implements this idea.

Any ideas? It would be great to discuss this issue.

UPD1 : Directly sent by request to

https://pu.vk.com/.../upload.php?act=add_doc&...&type=audio_message&hash=...&rhash=...&vk=1&upldr=1&ajx=1
in which the field waveformcontains an array of floating point numbers
[0.0025046887021744624,0.521343506872654,0.020314362656790763,0.013188361132051796,0.01548068062402308,0.009053641493665054,0.007106488337740302,0.0073724764079088345,0.0053099452634342015,0.0031113633667700924,0.003474715049378574,0.003223085339413956,0.0035720258820219897,0.0032625560561427847,0.003101676920778118,0.0034641060847206973,0.0023046086134854704,0.002771189232589677,0.0029588705801870674,0.0027419334364822134,0.0054213751427596435,0.0034913018898805603,0.0041494127217447385,0.0027188713720533997,0.003310464548121672,0.0029686420602956787,0.0028584430328919552,0.002861494787794072,0.003027575890882872,0.0024263075465569273,0.0028940795455127954,0.0024330782471224666,0.0026059808005811647,0.0025474588328506798]

The response comes with some string with parameters separated by "|".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2021-02-27
@zkrvndm

What's stopping you from sending your audio as a regular file from the browser? I can give an example UserScript.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question