Audio Recognition -- File Scan Tool (Python Script)
ACRCloud provides Automatic Content Recognition services for Audio Fingerprinting based applications such as Audio Recognition (supports music, video, ads for both online and offline), Broadcast Monitoring, Second Screen, Copyright Protection and etc.
This tool can scan audio/video files and detect audios you want to recognize such as music, ads.
Supported Format:
Audio: mp3, wav, m4a, flac, aac, amr, ape, ogg ...
Video: mp4, mkv, wmv, flv, ts, avi ...
- Python
- backports.csv
- requests
- Follow one of the tutorials to create a project and get your host, access_key and access_secret.
For Windows System, you must install Python and pip.
Open your terminal and change to the script directory of acrcloud_scan_files_python-master. Then run the command:
pip install -r requirements.txt
You can run the following command to install it.
python -m pip install git+https://github.com/acrcloud/acrcloud_sdk_python
Or you can download the sdk and install it by following command.
sudo python setup.py install
Windows Runtime Library
X86: download and install Library(windows/vcredist_x86.exe)
x64: download and install Library(windows/vcredist_x64.exe)
_ ____ ____ ____ _ _
/ \ / ___| _ \ / ___| | ___ _ _ __| |
/ _ \| | | |_) | | | |/ _ \| | | |/ _` |
/ ___ \ |___| _ <| |___| | (_) | |_| | (_| |
/_/ \_\____|_| \_\\____|_|\___/ \____|\____|
Before you use this script,you must have acrcloud host,access_key and access_secret. If you haven't have these ,you can register one https://console.acrcloud.com/signup
Change the content of config.json,fill in your host, access_key and access_secret
{
"host": "xxxxx",
"access_key": "xxxxx",
"access_secret": "xxxxx"
}
python acrcloud_scan_files_python.py -d folder_path
python acrcloud_scan_files_python.py -f file_path
python acrcloud_scan_files_python.py -h get_usage_help
python acrcloud_scan_files_python.py -d ~/music
python acrcloud_scan_files_python.py -f ~/testfiles/test.mp3
"-s" ---- scan step. (The scan interval.)
"-r" ---- scan range. (The scan range.)
"-l" ---- use how many seconds to recongize. (recongizing length)
"-c" ---- set the config file path.
If you want to change scan interval or you want to set recognize range,you can add some params
Example:
python acrcloud_scan_files_python.py -f ~/testfiles/test.mp3 -s 30 -r 0-20
python acrcloud_scan_files_python.py -d ~/music -s 30
When Scan program occurs some errors,error detail will store in error_scan.txt,When the scan tasks are finished, you can rescan these error task.
Example:
python acrcloud_scan_files_python.py -e error_scan.txt
Default is scan folder where this script in.
The results are saved in the folder where this script in.