
Recherche avancée
Médias (91)
-
999,999
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Demon seed (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
The four of us are dying (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Corona radiata (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Lights in the sky (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (80)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (11785)
-
Problem with calculating and writing silence
3 mars 2023, par Bohdan PetrenkoBecause Discord sends no audio if user isn't talking, I need to calculate time after their latest voice data received and write some amout of silence to the buffer. I have this code for handling audio data :


private async Task OnVoiceReceived(VoiceNextConnection sender, VoiceReceiveEventArgs e)
{
 try
 {
 if (!_isRecording) return;
 
 if (e.User is null) return;

 if (!_circularBuffers.TryGetValue(e.User.Id, out var circularBuffer))
 {
 circularBuffer = new CircularBuffer(e.AudioFormat.SampleRate * e.AudioFormat.ChannelCount * 2 * _bufferDurationSeconds, 
 e.AudioFormat.ChannelCount);
 _circularBuffers[e.User.Id] = circularBuffer;
 }

 TimeSpan delay;

 if (!_lastVoiceActivity.TryGetValue(e.User.Id, out var lastData))
 {
 // If we don't have any data for this user, we assume that last data from this user was received at the same time as recording started
 delay = DateTimeOffset.Now - _recordingStartedAt;
 }
 else delay = DateTimeOffset.Now - lastData;

 // calculate how much silence we need to add to the buffer
 var silence = new byte[e.AudioFormat.SampleRate * e.AudioFormat.ChannelCount * 2 * (int)Math.Round(delay.TotalSeconds)];
 
 await circularBuffer.WriteAsync(silence);

 _lastVoiceActivity[e.User.Id] = DateTimeOffset.Now;
 
 
 await circularBuffer.WriteAsync(e.PcmData);
 }
 catch (Exception exception)
 {
 Log.Error(exception, "Error while receiving voice data");
 }
}



After the recording finishes, with ffmpeg I write buffers to .wav files and then mix audios.


I have a problem that sometimes amount of silence is wrong and espacially this can be heard after mixing audios of multiple users. Sometimes amount of silence is not enough and somtimes it's too long. For example, In conversation recording user 1 can respond to user 2 even before user 2 asks him or vice-versa, user 1 can respond too late. Also I found that the problem appears often after some data of the buffer was removed due to overfilling.


I tried to change formula to calculate silence, and add data duration when setting new value of
_lastVoiceActivity
but that just made the problem worse. Also I tried to add silence only if delay is more than 100ms but this also didn't help. For testing I use circular buffers which can contain 30 seconds of audio.

I use DSharpPlus for Discord and ffmpeg for mixing audios.


UPD : I found that if I don't remove data from buffers due to overfilling, the probles becomes almost invisible. So here is my CircularBuffer implementation :


public class CircularBuffer
{
 private readonly ConcurrentQueue<byte> _buffer;
 
 private readonly object _lockObject;
 private readonly int _bufferSize;

 public int Channels { get; private set; }

 public int Count
 {
 get
 {
 lock (_lockObject)
 {
 return _buffer.Count;
 }
 }
 }

 public CircularBuffer(int size, int channels)
 {
 _buffer = new ConcurrentQueue<byte>();
 _bufferSize = size;
 Channels = channels;
 _lockObject = new object();
 }

 public async Task WriteAsync(ReadOnlyMemory<byte> data)
 {
 lock (_lockObject)
 {
 if (data.Length > _bufferSize) data = data[^_bufferSize..];

 if (_buffer.Count + data.Length > _bufferSize)
 {
 var bytesToRemove = _buffer.Count + data.Length - _bufferSize;
 
 for (var i = 0; i < bytesToRemove; i++)
 {
 _buffer.TryDequeue(out _);
 }
 }
 
 for (var index = 0; index < data.Span.Length; index++)
 {
 var b = data.Span[index];
 _buffer.Enqueue(b);
 }
 }
 
 await Task.CompletedTask;
 }
 
 public async Task ReadAsync(Memory<byte> data)
 {
 lock (_lockObject)
 {
 if (data.Length > _buffer.Count)
 {
 data = data[.._buffer.Count];
 }
 
 for (var index = 0; index < data.Span.Length; index++)
 {
 _buffer.TryDequeue(out var b);
 data.Span[index] = b;
 }
 }

 await Task.CompletedTask;
 }

 public void Clear()
 {
 lock (_lockObject)
 {
 _buffer.Clear();
 }
 }
}
</byte></byte></byte></byte>


-
Revision 11e3ac62a5 : Fixing display size setting problem. Fix of https://code.google.com/p/webm/issu
23 août 2013, par Dmitry KovalevChanged Paths :
Modify /vp9/decoder/vp9_decodframe.c
Fixing display size setting problem.Fix of https://code.google.com/p/webm/issues/detail?id=608. We could have
used invalid display size equal to the previous frame size (not to the
current frame size).Change-Id : I91b576be5032e47084214052a1990dc51213e2f0
-
Control noise and duration values while extracting silences of a video using FFMPEG
15 avril 2017, par Jitender KumarI have a requirement where I need to cut the video in chunk size of 10 mints. For that I need to detect silences first . I know the command, which is given below :
-i "C:\tmp\Test1.mp4" -af silencedetect=noise=-20dB:d=.2-f null -
But I am really struggling to set the value of duration and noise in proportion that it can detect the silence near about 10 mints.
I need a help to set it out and also little bit of more information how both together work ?I have found link https://ffmpeg.org/ffmpeg-filters.html and under this section 6.60 silencedetect they have tried to explain about them. I see there that duration, we need to provide in seconds but I am completely fail to understand the purpose of noise.
Also I am executing this command on Window.