Log audio¶
Comet's audio logging enables you to store audio recordings and audio-based outputs from your experiments.
You can access and play the logged audio samples from the Comet UI to easily analyze its patterns and characteristics, from any starting point of your choice.
The following method can be used to log audio samples:
In addition all the audio samples logged to an Experiment can be view in the Single Experiment page tabs:
- Audio.
- Assets & Artifacts Tab:
audio
folder.
Discover more in our Working with Audio Data for Machine Learning in Python blog post.
For example, you could...
Analyze logged audio sources during the training of a voice-controlled assistant to uncover common speech patterns behind model errors.
Log an audio sample¶
You can log audio from file path or from numpy array. You can find a list of supported audio codecs here.
The example below logs one randomly generated audio sample as a numpy array.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
The sample_rate
argument is provided to support the automatic creation of a .wav
file from the provided numpy array with the scipy.io.wavfile.write()
method.
Additionally, you could use the overwrite
argument to overwrite any existing asset with the same name or add a metadata
argument to log extra information (such as tags) in a JSON format.