TrainAudioMatchClip
Trains Media Server to recognize an audio clip.
Type: asynchronous
Parameter | Description | Required |
---|---|---|
audiodata
|
The audio data to add. Send files to Media Server using a multipart/form-data HTTP POST request. | Set this or audiopath |
audiopath
|
The path of the file that contains the audio clip. The path must be absolute, or relative to the Media Server executable file. To strengthen security, Media Server can be configured to read files only from specified directories. For information about the directories that Media Server is permitted to read from, see the parameter AllowedInputDirectories. |
Set this or audiodata |
database
|
The name of the database to add the audio clip to. The database must already exist. | Yes |
identifier
|
A unique identifier for the clip (maximum 254 bytes). If you do not set this parameter, Media Server generates an identifier automatically. | No |
metadata
|
A comma-separated list of metadata key-value pairs to add to the clip. Separate keys from values using a colon (: ). To include a comma or colon in a key name or value, you must enclose the key name or value in quotation marks (" ) and escape any quotation marks that occur within the string with a backslash (\ ). |
No |
nullaudiodata
|
A Boolean value (default false) that specifies whether to discard the audio data when training is complete, rather than storing it in the database. | No |
Example
The following example trains Media Server by sending the path of the audio clip:
curl http://localhost:14000/action=TrainAudioMatchClip -F database=music -F audiopath=clip.wav
Alternatively, you can train Media Server by sending the audio data, for example:
curl http://localhost:14000/action=TrainAudioMatchClip -F database=music -F audiodata=@clip.wav
Response
This action is asynchronous, so Media Server always returns success accompanied by a token. You can use this token with the QueueInfo action to retrieve the status of your request.
<autnresponse> <action>QUEUEINFO</action> <response>SUCCESS</response> <responsedata> <actions> <action> <status>Finished</status> <queued_time>2018-May-18 07:19:15</queued_time> <time_in_queue>0</time_in_queue> <process_start_time>2018-May-18 07:19:15</process_start_time> <time_processing>8</time_processing> <process_end_time>2018-May-18 07:19:23</process_end_time> <identifier>8c8f7d414d071b3ba8dcfc8778a77f9d</identifier> <token>...</token> </action> </actions> </responsedata> </autnresponse>
The identifier
element contains the identifier that was assigned to the clip.