website logo
Auteur
avatar
thellier

Forum » » Création-Développement » » question multiview


Posté : 08-10-2012 13:48 icone du post

Merci zzd10h j'ai récupéré le source = je teste dès que je peut...

Je pense à ces modifs ci dessous:
1) ne pas recréer/libérer le dtobject pour chaque cycle (à tester)
2) calculer le bon nombre de ticks
3) faire du debug à la demande

>pas besoin de mettre ça sur Aminet c'est juste la recompilation des exemples du wiki avec qq petites modifs.
Ben si justement : car il y avait pas sur un aminet un binaire pour faire ça

==========================================
BOOL debug;


debug=(argc > 4 );

[...]

if ((dtobject = NewDTObject(argv[1], DTA_GroupID, GID_SOUND,SDTA_Volume,volume,TAG_END) ))
{
mydtt.MethodID = DTM_TRIGGER; /* Fill in the dtTrigger struct */
mydtt.dtt_GInfo = NULL;
mydtt.dtt_Function = STM_PLAY;
mydtt.dtt_Data = NULL;

res = GetDTAttrs(dtobject,SDTA_SampleLength,&longueur,SDTA_VoiceHeader,&vh,TAG_END);
samplesParSec = (int)vh->vh_SamplesPerSec ;
duree = (50*longueur)/samplesParSec; /* 50 ticks/sec */

if(debug) printf("Longueur %ld\n",longueur);
if(debug) printf("Samples sec %ld\n",samplesParSec);
if(debug) printf("Duree sec %ld\n",duree/50); /* 50 ticks/sec => /50 pour avoir le nb de secondes */

for (i=0;i {
/* The return value of the DTM_TRIGGER method used with the 8svx */
/* sound datatype is undefined in V39. This is likely to change */
/* in future versions of the Amiga operating system. */
dores = DoDTMethodA(dtobject, NULL, NULL, &mydtt);
Delay(duree); /* Let the 8svx sound finish playing. */
} /* fin for nb_cycle */

if(debug) printf("Fini\n");
DisposeDTObject(dtobject);
}
else
{
if(debug) printf("KO, est-ce bien un fichier son ?\n");
return 0;
}
Message édité par : thellier / 08-10-2012 13:49

Cet article provient de Le site des utilisateurs francophones actuels et futurs d'AmigaOS 4.x
https://amiga-ng.org/viewtopic.php?topic=1380&forum=14