Installation¶
You can simply use pip:
pip install cobalstamp
Then, you can run some python code, ex.:
python -c 'import cobalstamp; print(cobalstamp.__version__)'
API key¶
Cobalstamp is a “connected module”: First, you have to provide an API key in the environment variables that you obtain through the cobalstamp website, ex.:
export COBALSTAMP_KEY=api_duJhSwq878ii44VkyD0X3AIjG1eBpf0kZM3Zek4YXQHTlZhgGqxrWip7z6p8pyUW
The key must start with api_ and be exactly 68 characters long.
License verification¶
When loading the module with import cobalstamp, the license is checked
through the network and validated.
This validation process starts when the module is loading, in the background,
which minimize any delay before audio processing.
If the license is not valid, and you run any processing function, a
RuntimeError exception will be raised.
Note
No matter the validity of your license, you will always be able to import the cobalstamp module. This is to avoid that a licensing issue blocks a whole service that makes use of cobalstamp.
Note
When marking, the audio is processed locally on your machine. When detecting, the audio is sent to the server, which looks for registered marks in it (see Marking).
Testing¶
To verify that everything is setup properly, you can run the tests provided with the module:
python -c 'import cobalstamp.tests; cobalstamp.tests.run()'
This runs smoke tests.
Note that this command does not run all regression tests, as they are too heavy to be shipped with the python module.