PDA

View Full Version : [C] Fmod - length


max246
05-11-2005, 21:37
Ciao,
sono confuso... come faccio a convertire la lungezza di un mp3 data in SAMPLES in secondi o millisecondi?
La libreria usata è l'FMOD qua il codice:

FSOUND_Init (44100, 32, 0);
handle=FSOUND_Sample_Load (0,dati_mp3[numero_mp3].mp3source,0, 0, 0);
FSOUND_PlaySound (0,handle);
durata = FSOUND_Sample_GetLength(handle);

La definizione della guida:


FSOUND_Sample_GetLength
Returns the length of the sample in SAMPLES

unsigned int F_API FSOUND_Sample_GetLength(
FSOUND_SAMPLE *sptr
);


Parameters
sptr Pointer to the sample to get the length from.


Return Value
On success, the length of sample in SAMPLES is returned.
On failure, 0 is returned.