libZPlay documentation (Win32)
IndexReferenceHome
PreviousUpNext
libZPlayCpp::zplay_DetectFileBPMW Function

Detect beat-per-minute value of specified file. (UNICODE version)

C++
__stdcall __declspec(dllimport) int zplay_DetectFileBPMW(ZPLAY_HANDLE handle, const wchar_t * pchFileName, TStreamFormat nFormat, TBMPDetectionMethod nMethod);
Parameters 
Description 
ZPLAY_HANDLE handle 
ZPLAY handle. Get this handle with zplay_CreateZPlay
const wchar_t * pchFileName 
Pointer to UNICODE null terminated string specifying file name. 
TStreamFormat nFormat 
Stream format identifier. Use sfAutodetect if you need to autodetect stream format of specified file. 
TBMPDetectionMethod nMethod 
Detection method. See valid detection methods

BPM value. If algorithm can't detect BPM value, return value is 0.

This function will open temporary stream and detect beat-per-minute. When detection process is done, stream will be closed. 

Note: Detection process can take some time. 

Warning: This function WILL NOT interfere with current playing. 

BPM detection algorithm isn't 100 % accurate. Algorithm will stop when first valid BPM value is detected. If BPM value can't be detected, algorithm will try to search whole stream. If this fails, returned BPM value is 0.

Detect BPM value of specified file using "peak detection" method 

ZPlay C++ Class interface  

// use "peak detection" method to detect BPM value
int BPM = instance->DetectFileBPMW(L"mysong.mp3", sfAutodetect, dmPeaks);

C Style interface

// use "peak detection" method to detect BPM value
int BPM = zplay_DetectBPMW(L"mysong.mp3", sfAutodetect, instance, dmPeaks);
Copyright (c) 2010. Zoran Cindori - All rights reserved.

Web: http://libzplay.sourceforge.net/

Email: zcindori@inet.hr