0
0

Hello,

I have a little problem : I use fmod and its fonctions but I don’t know how to reach length of sounds in SECOND.
I use ‘FSOUND_Sample_Load’ to load sound. And I use ‘FSOUND_Sample_GetLength’ to obtain length but it is in SAMPLE.

So I don’t know if it exists function that give length in SECOND when I use sample functions ??
Otherwise I’d like to know how I can reach sample frequency to convert number of sample in time (seconds).

Any help would be greatly appreciated. Thanks.

Jjju

  • You must to post comments
0
0

Using FSOUND_Sample_GetDefaults you can get sampling rate (if you don’t know it already), then, if you have length in Samples you can get length in seconds this way:

length [secs] = length [samples] / sampling rate

ciao
Davide

  • You must to post comments
0
0

Thank you for your help.

Now I have length in seconds and it’s perfect !
Thanks.

Jjju

  • You must to post comments
0
0

Hi
I have the same problem
but I don’t understand !!! :)

FSOUND_Sample_GetDefaults
Returns the default volume, frequency, pan and priority values for the specified sample.

signed char F_API FSOUND_Sample_GetDefaults
(FSOUND_SAMPLE *sptr,int *deffreq,int *defvol,int *defpan,int *defpri);

I don’t see how can I get sampling rate here !!

if you can help again …..
thx !

  • You must to post comments
0
0

frequency (deffreq) is the sampling rate… isn’t it?

ciao
Davide

  • You must to post comments
0
0

yes
:)
sorry

but we have trouble and segfaults with !

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.