
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (78)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (5944)
-
Hit noise when playing part of wave file with ALSA PCM interface
11 décembre 2024, par wangt13I am working a WAVE file playing with ALSA PCM interface in Linux, and I heard noise when I played the file quickly and partially.


Here is my playing function.


static int playback_function(uint8_t *pcm_buf, int pcm_frames)
{
 int rc;
 uint8_t *buf;
 int frame_size, sent;
 int periodsize;
 int left;

 frame_size = chan * av_get_bytes_per_sample(AV_SAMPLE_FMT_S16);
 periodsize = sys_periodsize; // 320 in my system
 buf = pcm_buf;
 left = pcm_frames;
 sent = 0;

 while (left > 0) {
 sent = (left > periodsize) ? periodsize : left;
 rc = snd_pcm_writei(pcm_handle, buf, sent);
 printf("rc: %d, sent: %d\n", rc, sent);
 if (rc == -EAGAIN || (rc >= 0 && (size_t)rc < sent)) {
 snd_pcm_wait(pcm_handle, 10);
 } else if (rc == -EPIPE) {
 snd_pcm_recover(pcm_handle, rc, 0);
 } else if (rc < 0) {
 break;
 }
 if (rc > 0) {
 left -= rc;
 buf += rc * frame_size;
 }
 }
 return rc;
}



The
pcm_buf
andpcm_frames
are got fromswr_convert()
inlibswresample
, in my case, thepcm_frames
is 1187.

By adding
printf("rc: %d, sent: %d\n", rc, sent);
, I got following logs.

rc: 320, sent: 320
rc: 87, sent: 87
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103
rc: 320, sent: 320
rc: 320, sent: 320
rc: 87, sent: 87
rc: 320, sent: 320
rc: 320, sent: 320
rc: 103, sent: 103



With above function, sometimes I can hear noise when playing the WAVE file quickly and repeatly.

So, how can I improve the WAVE playing without the noise ??

I changed the above function by using filling
0
to the end of data buffer (to enforce silence).

static int playback_test(uint8_t *pcm_buf, int pcm_frames)
{
 uint8_t *buf;
 int trd;
 int rc;
 int left;
 int frame_size, sent;
 int periodsize;
 int aligned = 0;

 frame_size = chan * av_get_bytes_per_sample(AV_SAMPLE_FMT_S16);
 periodsize = sys_periodsize; // 320 in my system

 buf = pcm_buf;
 left = pcm_frames;
 aligned = (left/periodsize + 1) * periodsize;
 memset(buf + left * frame_size, 0, (aligned - left) * frame_size);
 sent = 0;
///left = periodsize; // <== This causes more noise!!

 while (left > 0) {
 sent = (left > periodsize) ? periodsize : left;
 rc = snd_pcm_writei(pcm_handle, buf, sent);
 printf("rc: %d, sent: %d\n", rc, sent);
 if (rc == -EAGAIN || (rc >= 0 && (size_t)rc < sent)) {
 snd_pcm_wait(pcm_handle, 10);
 } else if (rc == -EPIPE) {
 snd_pcm_recover(pcm_handle, rc, 0);
 } else if (rc < 0) {
 break;
 }
 if (rc > 0) {
 left -= rc;
 buf += rc * frame_size;
 }
 }
 return rc;
}



There is NO improvement as of the noise.


-
jpeg2000dec : fix tile-part header state reset
24 octobre 2024, par Pierre-Anthony Lemieuxjpeg2000dec : fix tile-part header state reset
-
fftools/ffmpeg_enc : split Encoder into a private and public part
24 septembre 2024, par Anton Khirnovfftools/ffmpeg_enc : split Encoder into a private and public part
Similar to what was previously done for other components, e.g. decoders
(see 3b84140a1bb5a5b3044915888a40a7b619921633).Start by moving samples,frames_encoded into the public struct.