mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-06 23:20:03 +01:00
Expose BPM detector beat position and strength retrieval API via SoundTouchDLL.
This commit is contained in:
parent
63db6bf344
commit
808bf021e6
@ -562,3 +562,21 @@ SOUNDTOUCHDLL_API float __cdecl bpm_getBpm(HANDLE h)
|
|||||||
|
|
||||||
return bpmh->pbpm->getBpm();
|
return bpmh->pbpm->getBpm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Get beat position arrays. Note: The array includes also really low beat detection values
|
||||||
|
/// in absence of clear strong beats. Consumer may wish to filter low values away.
|
||||||
|
/// - "pos" receive array of beat positions
|
||||||
|
/// - "values" receive array of beat detection strengths
|
||||||
|
/// - max_num indicates max.size of "pos" and "values" array.
|
||||||
|
///
|
||||||
|
/// You can query a suitable array sized by calling this with nullptr in "pos" & "values".
|
||||||
|
///
|
||||||
|
/// \return number of beats in the arrays.
|
||||||
|
SOUNDTOUCHDLL_API int __cdecl bpm_getBeats(HANDLE h, float* pos, float* strength, int count)
|
||||||
|
{
|
||||||
|
BPMHANDLE *bpmh = (BPMHANDLE *)h;
|
||||||
|
if (bpmh->dwMagic != BPMMAGIC) return 0;
|
||||||
|
|
||||||
|
return bpmh->pbpm->getBeats(pos, strength, count);
|
||||||
|
}
|
||||||
|
|||||||
@ -225,5 +225,16 @@ SOUNDTOUCHDLL_API void __cdecl bpm_putSamples_i16(HANDLE h,
|
|||||||
/// \return Beats-per-minute rate, or zero if detection failed.
|
/// \return Beats-per-minute rate, or zero if detection failed.
|
||||||
SOUNDTOUCHDLL_API float __cdecl bpm_getBpm(HANDLE h);
|
SOUNDTOUCHDLL_API float __cdecl bpm_getBpm(HANDLE h);
|
||||||
|
|
||||||
|
/// Get beat position arrays. Note: The array includes also really low beat detection values
|
||||||
|
/// in absence of clear strong beats. Consumer may wish to filter low values away.
|
||||||
|
/// - "pos" receive array of beat positions
|
||||||
|
/// - "values" receive array of beat detection strengths
|
||||||
|
/// - max_num indicates max.size of "pos" and "values" array.
|
||||||
|
///
|
||||||
|
/// You can query a suitable array sized by calling this with nullptr in "pos" & "values".
|
||||||
|
///
|
||||||
|
/// \return number of beats in the arrays.
|
||||||
|
SOUNDTOUCHDLL_API int __cdecl bpm_getBeats(HANDLE h, float *pos, float *strength, int count);
|
||||||
|
|
||||||
#endif // _SoundTouchDLL_h_
|
#endif // _SoundTouchDLL_h_
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user