"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.AudioLevelObserverOptionsT = exports.AudioLevelObserverOptions = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
class AudioLevelObserverOptions {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsAudioLevelObserverOptions(bb, obj) {
        return (obj || new AudioLevelObserverOptions()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsAudioLevelObserverOptions(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new AudioLevelObserverOptions()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    maxEntries() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
    }
    threshold() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
    }
    interval() {
        const offset = this.bb.__offset(this.bb_pos, 8);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
    }
    static startAudioLevelObserverOptions(builder) {
        builder.startObject(3);
    }
    static addMaxEntries(builder, maxEntries) {
        builder.addFieldInt16(0, maxEntries, 0);
    }
    static addThreshold(builder, threshold) {
        builder.addFieldInt8(1, threshold, 0);
    }
    static addInterval(builder, interval) {
        builder.addFieldInt16(2, interval, 0);
    }
    static endAudioLevelObserverOptions(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createAudioLevelObserverOptions(builder, maxEntries, threshold, interval) {
        AudioLevelObserverOptions.startAudioLevelObserverOptions(builder);
        AudioLevelObserverOptions.addMaxEntries(builder, maxEntries);
        AudioLevelObserverOptions.addThreshold(builder, threshold);
        AudioLevelObserverOptions.addInterval(builder, interval);
        return AudioLevelObserverOptions.endAudioLevelObserverOptions(builder);
    }
    unpack() {
        return new AudioLevelObserverOptionsT(this.maxEntries(), this.threshold(), this.interval());
    }
    unpackTo(_o) {
        _o.maxEntries = this.maxEntries();
        _o.threshold = this.threshold();
        _o.interval = this.interval();
    }
}
exports.AudioLevelObserverOptions = AudioLevelObserverOptions;
class AudioLevelObserverOptionsT {
    maxEntries;
    threshold;
    interval;
    constructor(maxEntries = 0, threshold = 0, interval = 0) {
        this.maxEntries = maxEntries;
        this.threshold = threshold;
        this.interval = interval;
    }
    pack(builder) {
        return AudioLevelObserverOptions.createAudioLevelObserverOptions(builder, this.maxEntries, this.threshold, this.interval);
    }
}
exports.AudioLevelObserverOptionsT = AudioLevelObserverOptionsT;
