Spaces:
Runtime error
Runtime error
File size: 23,282 Bytes
0e27770 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | /**
* AI Mastering API
* This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.
*
* OpenAPI spec version: 1.0.0
* Contact: info@bakuage.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.3.1
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Mastering'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Mastering'));
} else {
// Browser globals (root is window)
if (!root.Aimastering) {
root.Aimastering = {};
}
root.Aimastering.MasteringApi = factory(root.Aimastering.ApiClient, root.Aimastering.Mastering);
}
}(this, function(ApiClient, Mastering) {
'use strict';
/**
* Mastering service.
* @module api/MasteringApi
* @version 1.1.0
*/
/**
* Constructs a new MasteringApi.
* @alias module:api/MasteringApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
* Callback function to receive the result of the cancelMastering operation.
* @callback module:api/MasteringApi~cancelMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Cancel a mastering by id.
* @param {Number} id Mastering id
* @param {module:api/MasteringApi~cancelMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.cancelMastering = function(id, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling cancelMastering");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['bearer'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}/cancel', 'PUT',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the createMastering operation.
* @callback module:api/MasteringApi~createMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Create a new mastering.
* @param {Number} inputAudioId Input audio id
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.mode Mode (default to default)
* @param {Boolean} opts.bassPreservation This parameter represents if the bass preservation is enabled. (default to false)
* @param {Boolean} opts.mastering This parameter represents if the mastering is enabled. This parameter is effective only when the mode is \"default\" or \"custom\". (default to false)
* @param {module:model/String} opts.masteringAlgorithm (default to v2)
* @param {Boolean} opts.noiseReduction This parameter represents if the nosie reduction is enabled. This parameter is effective only when the mode is \"custom\". (default to false)
* @param {module:model/String} opts.preset This parameter is effective only when the mode is \"custom\". (default to general)
* @param {Number} opts.targetLoudness This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is \"custom\". (default to -5)
* @param {module:model/String} opts.targetLoudnessMode (default to loudness)
* @param {Number} opts.masteringMatchingLevel This parameter represents the mastering reference matching level. This parameter is effective only when the mode is \"custom\" and the mastering is enabled. (default to 0.5)
* @param {Boolean} opts.masteringReverb This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is \"custom\" and the mastering is enabled. (default to false)
* @param {Number} opts.masteringReverbGain This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is \"custom\" and the mastering is \"true\" and the mastering_reverb is \"true\". (default to -36)
* @param {Number} opts.referenceAudioId Reference audio id. This parameter is effective only when the mode is \"custom\" and the mastering is enabled.
* @param {Number} opts.lowCutFreq This parameter represents the low cut freq of the output audio in Hz. This parameter is effective only when the mode is \"custom\". (default to 20)
* @param {Number} opts.highCutFreq This parameter represents the high cut freq of the output audio in Hz. This parameter is effective only when the mode is \"custom\". (default to 20000)
* @param {Number} opts.ceiling (default to 0)
* @param {module:model/String} opts.ceilingMode (default to 0)
* @param {Number} opts.oversample (default to 1)
* @param {Number} opts.sampleRate This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is \"custom\". (default to 44100)
* @param {Number} opts.bitDepth This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is \"custom\". (default to 16)
* @param {module:model/String} opts.outputFormat This parameter represents the format of the output audio. This parameter is effective only when the mode is \"custom\". (default to wav)
* @param {Boolean} opts.forPreview If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime). (default to false)
* @param {Number} opts.startAt Partial mastering start at. (default to 0)
* @param {Number} opts.endAt Partial mastering end at. (default to -1)
* @param {String} opts.videoTitle This parameter represents the title of output video. (default to )
* @param {module:api/MasteringApi~createMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.createMastering = function(inputAudioId, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'inputAudioId' is set
if (inputAudioId === undefined || inputAudioId === null) {
throw new Error("Missing the required parameter 'inputAudioId' when calling createMastering");
}
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
'mode': opts['mode'],
'input_audio_id': inputAudioId,
'bass_preservation': opts['bassPreservation'],
'mastering': opts['mastering'],
'mastering_algorithm': opts['masteringAlgorithm'],
'noise_reduction': opts['noiseReduction'],
'preset': opts['preset'],
'target_loudness': opts['targetLoudness'],
'target_loudness_mode': opts['targetLoudnessMode'],
'mastering_matching_level': opts['masteringMatchingLevel'],
'mastering_reverb': opts['masteringReverb'],
'mastering_reverb_gain': opts['masteringReverbGain'],
'reference_audio_id': opts['referenceAudioId'],
'low_cut_freq': opts['lowCutFreq'],
'high_cut_freq': opts['highCutFreq'],
'ceiling': opts['ceiling'],
'ceiling_mode': opts['ceilingMode'],
'oversample': opts['oversample'],
'sample_rate': opts['sampleRate'],
'bit_depth': opts['bitDepth'],
'output_format': opts['outputFormat'],
'for_preview': opts['forPreview'],
'start_at': opts['startAt'],
'end_at': opts['endAt'],
'video_title': opts['videoTitle']
};
var authNames = ['bearer'];
var contentTypes = ['multipart/form-data'];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings', 'POST',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the deleteMastering operation.
* @callback module:api/MasteringApi~deleteMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Delete mastering.
* @param {Number} id Mastering id
* @param {module:api/MasteringApi~deleteMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.deleteMastering = function(id, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling deleteMastering");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['bearer'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}', 'DELETE',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the freeUnlockMastering operation.
* @callback module:api/MasteringApi~freeUnlockMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Free unlock a mastering by id.
* @param {Number} id Mastering id
* @param {module:api/MasteringApi~freeUnlockMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.freeUnlockMastering = function(id, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling freeUnlockMastering");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['bearer'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}/free_unlock', 'PUT',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the getMastering operation.
* @callback module:api/MasteringApi~getMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get a mastering by id.
* @param {Number} id Mastering id
* @param {module:api/MasteringApi~getMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.getMastering = function(id, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling getMastering");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['bearer'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the getMasteringUnlockProduct operation.
* @callback module:api/MasteringApi~getMasteringUnlockProductCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Review a mastering by id.
* @param {Number} id Mastering id
* @param {module:api/MasteringApi~getMasteringUnlockProductCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.getMasteringUnlockProduct = function(id, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling getMasteringUnlockProduct");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['bearer'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}/unlock_product', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the listMasterings operation.
* @callback module:api/MasteringApi~listMasteringsCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/Mastering>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get all accessable masterings.
* @param {module:api/MasteringApi~listMasteringsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Mastering>}
*/
this.listMasterings = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['bearer'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = [Mastering];
return this.apiClient.callApi(
'/masterings', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the publishMastering operation.
* @callback module:api/MasteringApi~publishMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Publish a mastering by id.
* @param {Number} id Mastering id
* @param {String} accessToken This parameter represents if the access token of the publishment service API.
* @param {String} message This parameter represents the publishment message.
* @param {Object} opts Optional parameters
* @param {module:model/String} opts.service This parameter represents the publishment service.
* @param {String} opts.accessTokenSecret This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is \"twitter\".
* @param {module:api/MasteringApi~publishMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.publishMastering = function(id, accessToken, message, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling publishMastering");
}
// verify the required parameter 'accessToken' is set
if (accessToken === undefined || accessToken === null) {
throw new Error("Missing the required parameter 'accessToken' when calling publishMastering");
}
// verify the required parameter 'message' is set
if (message === undefined || message === null) {
throw new Error("Missing the required parameter 'message' when calling publishMastering");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
'service': opts['service'],
'access_token': accessToken,
'access_token_secret': opts['accessTokenSecret'],
'message': message
};
var authNames = ['bearer'];
var contentTypes = ['multipart/form-data'];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}/publish', 'POST',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the reviewMastering operation.
* @callback module:api/MasteringApi~reviewMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Review a mastering by id.
* @param {Number} id Mastering id
* @param {Object} opts Optional parameters
* @param {String} opts.reviewComment This parameter represents the review comment.
* @param {Number} opts.reviewScore This parameter represents the review score.
* @param {module:api/MasteringApi~reviewMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.reviewMastering = function(id, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling reviewMastering");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
'review_comment': opts['reviewComment'],
'review_score': opts['reviewScore']
};
var authNames = ['bearer'];
var contentTypes = ['multipart/form-data'];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}/review', 'PUT',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the updateMastering operation.
* @callback module:api/MasteringApi~updateMasteringCallback
* @param {String} error Error message, if any.
* @param {module:model/Mastering} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Update a mastering.
* @param {Number} id Mastering id
* @param {Object} opts Optional parameters
* @param {Boolean} opts.preserved Disable auto delete.
* @param {module:api/MasteringApi~updateMasteringCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Mastering}
*/
this.updateMastering = function(id, opts, callback) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling updateMastering");
}
var pathParams = {
'id': id
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
'preserved': opts['preserved']
};
var authNames = ['bearer'];
var contentTypes = ['multipart/form-data'];
var accepts = ['application/json'];
var returnType = Mastering;
return this.apiClient.callApi(
'/masterings/{id}', 'PUT',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));
|