package androidx.media3.decoder.midi;

import android.content.Context;
import com.jsyn.unitgen.y;
import y0.g;

/* JADX INFO: loaded from: classes.dex */
final class SonivoxVoiceDescription extends g {
    private static final String VOICE_CLASS_NAME = "SonivoxVoiceDescription";
    private static SonivoxVoiceDescription instance;
    private final short[] waveTableData;
    private static final String[] tags = {"wavetable", "GM2", "ringtone"};
    private static final Object LOCK = new Object();

    private SonivoxVoiceDescription(short[] sArr) {
        super(VOICE_CLASS_NAME, SonivoxWaveData.getProgramNames());
        this.waveTableData = sArr;
    }

    public static SonivoxVoiceDescription getInstance(Context context) throws MidiDecoderException {
        SonivoxVoiceDescription sonivoxVoiceDescription;
        synchronized (LOCK) {
            try {
                if (instance == null) {
                    instance = new SonivoxVoiceDescription(SonivoxWaveData.loadWaveTableData(context));
                }
                sonivoxVoiceDescription = instance;
            } catch (Throwable th) {
                throw th;
            }
        }
        return sonivoxVoiceDescription;
    }

    @Override // y0.g
    public y createUnitVoice() {
        return new SonivoxSynthVoice(this.waveTableData);
    }

    public String[] getTags(int i2) {
        return tags;
    }

    public String getVoiceClassName() {
        return VOICE_CLASS_NAME;
    }
}
