
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (23)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...) -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)
Sur d’autres sites (5128)
-
Anomalie #4219 (Fermé) : #URL_ACTION_AUTEUR{truc} génère un Warning
11 février 2021, par cedric -Pourquoi rendre arg obligatoire ? ou pourquoi rendre redirect obligatoire ?
En pratique on est bien obligé de mettre un argument avant l’autre donc l’un des deux sera obligatoire si on veut mettre le 3eme.
On peut en effet permettre à arg d’etre par defaut vide, intégré par https://git.spip.net/spip/spip/commit/4b8585a0f29674db1def72923ae0c96e27146545
-
Revision 66349 : On teste une autre méthode d’affichage des vues qui permet plus de choses ...
29 septembre 2012, par rastapopoulos@… — LogOn teste une autre méthode d’affichage des vues qui permet plus de choses : on caclule d’abord la réponse SANS le "sans réponse", vu que de toute façon c’était en #INCLURE déjà. Pour dire qu’il n’y a pas de réponse, les sous-squelettes doivent renvoyer du VIDE.
Cela permet déjà d’ajouter une classe "sans_reponse" globale autour. -
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.