@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
114 lines • 5.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SoundActionPlaySound = void 0;
class SoundActionPlaySound {
constructor(data) {
let encodingDefault = "Raw";
this.encoding = typeof (data === null || data === void 0 ? void 0 : data.encoding) !== "undefined" ? data === null || data === void 0 ? void 0 : data.encoding : encodingDefault;
let mixDefault = false;
this.mix = typeof (data === null || data === void 0 ? void 0 : data.mix) !== "undefined" ? data === null || data === void 0 ? void 0 : data.mix : mixDefault;
let repeatDefault = false;
this.repeat = typeof (data === null || data === void 0 ? void 0 : data.repeat) !== "undefined" ? data === null || data === void 0 ? void 0 : data.repeat : repeatDefault;
let sampleSizeDefault = 8;
this.sampleSize = typeof (data === null || data === void 0 ? void 0 : data.sampleSize) !== "undefined" ? data === null || data === void 0 ? void 0 : data.sampleSize : sampleSizeDefault;
let samplingRateDefault = 8000;
this.samplingRate = typeof (data === null || data === void 0 ? void 0 : data.samplingRate) !== "undefined" ? data === null || data === void 0 ? void 0 : data.samplingRate : samplingRateDefault;
this.sound = data.sound;
let soundChannelsDefault = 1;
this.soundChannels = typeof (data === null || data === void 0 ? void 0 : data.soundChannels) !== "undefined" ? data === null || data === void 0 ? void 0 : data.soundChannels : soundChannelsDefault;
let synchronousDefault = false;
this.synchronous = typeof (data === null || data === void 0 ? void 0 : data.synchronous) !== "undefined" ? data === null || data === void 0 ? void 0 : data.synchronous : synchronousDefault;
let volumeDefault = 100;
this.volume = typeof (data === null || data === void 0 ? void 0 : data.volume) !== "undefined" ? data === null || data === void 0 ? void 0 : data.volume : volumeDefault;
}
static getEncodingDefault() {
return "Raw";
}
static getEncodingDescription() {
return "The encoding of the audio file. Possible values are:\n\n* Raw\n* Signed\n* muLaw\n* ALaw";
}
static getMixDefault() {
return false;
}
static getMixDescription() {
return "If this value is set to true, it will be possible to play the audio track at the same time as other audio tracks. If it is set to false instead, any audio tracks that were already playing will be stopped previously.";
}
static getRepeatDefault() {
return false;
}
static getRepeatDescription() {
return "If this value is set to true, the audio track should be repeated endlessly.";
}
static getSampleSizeDefault() {
return 8;
}
static getSampleSizeDescription() {
return "The number of bits per sample per audio channel.";
}
static getSampleSizeMin() {
return 1;
}
static getSamplingRateDefault() {
return 8000;
}
static getSamplingRateDescription() {
return "The Sample Rate in Samples per Second.";
}
static getSamplingRateMin() {
return 1;
}
static getSoundDescription() {
return "The audio file that should be played. The file must be encoded as a BASE64 value. The passed file must be completely independent and contain all the information and data required to play it. The AIFF, AIFF-C, RIFF (\\*.wav), snd(\\*.au) audio formats are supported, for example.";
}
static getSoundChannelsDefault() {
return 1;
}
static getSoundChannelsDescription() {
return "The number of audio channels.";
}
static getSoundChannelsMin() {
return 1;
}
static getSynchronousDefault() {
return false;
}
static getSynchronousDescription() {
return "If this value is set to true, the reader program must guarantee that the audio track will be plated in a completely synchronized manner without any interruptions and, accordingly, suppress any user interaction (except for cancelling the audio) while the audio is playing.";
}
static getVolumeDefault() {
return 100;
}
static getVolumeDescription() {
return "A floating-point number between 100 and -100 that configures the volume for audio playback (as a percentage).";
}
static getVolumeMin() {
return -100;
}
static getVolumeMax() {
return 100;
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new SoundActionPlaySound(data);
}
toJson() {
return {
'encoding': this.encoding,
'mix': this.mix,
'repeat': this.repeat,
'sampleSize': this.sampleSize,
'samplingRate': this.samplingRate,
'sound': this.sound,
'soundChannels': this.soundChannels,
'synchronous': this.synchronous,
'volume': this.volume,
};
}
clone() {
return SoundActionPlaySound.fromJson(this.toJson());
}
}
exports.SoundActionPlaySound = SoundActionPlaySound;
//# sourceMappingURL=SoundActionPlaySound.js.map