import typing

import android.app
import android.content
import android.media
import android.net
import android.os
import java
import java.chaquopy
import java.io
import java.lang
import java.util

class SynthesisCallback(java.lang.Object):
    def audioAvailable(self, arg1: java.chaquopy.JavaArrayJByte, arg2: int | java.jint | java.lang.Integer, arg3: int | java.jint | java.lang.Integer, /) -> int: ...
    def done(self) -> int: ...
    @typing.overload
    def error(self) -> None: ...
    @typing.overload
    def error(self, arg1: int | java.jint | java.lang.Integer, /) -> None: ...
    def getMaxBufferSize(self) -> int: ...
    def hasFinished(self) -> bool: ...
    def hasStarted(self) -> bool: ...
    def rangeStart(self, markerInFrames: int | java.jint | java.lang.Integer, start: int | java.jint | java.lang.Integer, end: int | java.jint | java.lang.Integer, /) -> None: ...
    def start(self, arg1: int | java.jint | java.lang.Integer, arg2: int | java.jint | java.lang.Integer, arg3: int | java.jint | java.lang.Integer, /) -> int: ...

class SynthesisRequest(java.lang.Object):
    @typing.overload
    def __init__(self, text: java.lang.CharSequence, params: android.os.Bundle, /) -> None: ...
    @typing.overload
    def __init__(self, text: str | java.lang.String, params: android.os.Bundle, /) -> None: ...
    def getCallerUid(self) -> int: ...
    def getCharSequenceText(self) -> java.lang.CharSequence: ...
    def getCountry(self) -> str: ...
    def getLanguage(self) -> str: ...
    def getParams(self) -> android.os.Bundle: ...
    def getPitch(self) -> int: ...
    def getSpeechRate(self) -> int: ...
    def getText(self) -> str: ...
    def getVariant(self) -> str: ...
    def getVoiceName(self) -> str: ...

class TextToSpeech(java.lang.Object):
    ACTION_TTS_QUEUE_PROCESSING_COMPLETED: typing.ClassVar[str] = ...
    ERROR: typing.ClassVar[int] = ...
    ERROR_INVALID_REQUEST: typing.ClassVar[int] = ...
    ERROR_NETWORK: typing.ClassVar[int] = ...
    ERROR_NETWORK_TIMEOUT: typing.ClassVar[int] = ...
    ERROR_NOT_INSTALLED_YET: typing.ClassVar[int] = ...
    ERROR_OUTPUT: typing.ClassVar[int] = ...
    ERROR_SERVICE: typing.ClassVar[int] = ...
    ERROR_SYNTHESIS: typing.ClassVar[int] = ...
    LANG_AVAILABLE: typing.ClassVar[int] = ...
    LANG_COUNTRY_AVAILABLE: typing.ClassVar[int] = ...
    LANG_COUNTRY_VAR_AVAILABLE: typing.ClassVar[int] = ...
    LANG_MISSING_DATA: typing.ClassVar[int] = ...
    LANG_NOT_SUPPORTED: typing.ClassVar[int] = ...
    QUEUE_ADD: typing.ClassVar[int] = ...
    QUEUE_FLUSH: typing.ClassVar[int] = ...
    STOPPED: typing.ClassVar[int] = ...
    SUCCESS: typing.ClassVar[int] = ...
    @typing.overload
    def __init__(self, context: android.content.Context, listener: TextToSpeech.OnInitListener, /) -> None: ...
    @typing.overload
    def __init__(self, context: android.content.Context, listener: TextToSpeech.OnInitListener, engine: str | java.lang.String, /) -> None: ...
    @typing.overload
    def addEarcon(self, earcon: str | java.lang.String, uri: android.net.Uri, /) -> int: ...
    @typing.overload
    def addEarcon(self, earcon: str | java.lang.String, file: java.io.File, /) -> int: ...
    @typing.overload
    def addEarcon(self, earcon: str | java.lang.String, filename: str | java.lang.String, /) -> int: ...
    @typing.overload
    def addEarcon(self, earcon: str | java.lang.String, packagename: str | java.lang.String, resourceId: int | java.jint | java.lang.Integer, /) -> int: ...
    @typing.overload
    def addSpeech(self, text: java.lang.CharSequence, uri: android.net.Uri, /) -> int: ...
    @typing.overload
    def addSpeech(self, text: java.lang.CharSequence, file: java.io.File, /) -> int: ...
    @typing.overload
    def addSpeech(self, text: str | java.lang.String, filename: str | java.lang.String, /) -> int: ...
    @typing.overload
    def addSpeech(self, text: java.lang.CharSequence, packagename: str | java.lang.String, resourceId: int | java.jint | java.lang.Integer, /) -> int: ...
    @typing.overload
    def addSpeech(self, text: str | java.lang.String, packagename: str | java.lang.String, resourceId: int | java.jint | java.lang.Integer, /) -> int: ...
    def areDefaultsEnforced(self) -> bool: ...
    def getAvailableLanguages(self) -> java.util.Set[java.util.Locale]: ...
    def getDefaultEngine(self) -> str: ...
    def getDefaultLanguage(self) -> java.util.Locale: ...
    def getDefaultVoice(self) -> Voice: ...
    def getEngines(self) -> java.util.List[TextToSpeech.EngineInfo]: ...
    def getFeatures(self, locale: java.util.Locale, /) -> java.util.Set[java.lang.String]: ...
    def getLanguage(self) -> java.util.Locale: ...
    @staticmethod
    def getMaxSpeechInputLength() -> int: ...
    def getVoice(self) -> Voice: ...
    def getVoices(self) -> java.util.Set[Voice]: ...
    def isLanguageAvailable(self, loc: java.util.Locale, /) -> int: ...
    def isSpeaking(self) -> bool: ...
    @typing.overload
    def playEarcon(self, earcon: str | java.lang.String, queueMode: int | java.jint | java.lang.Integer, params: java.util.HashMap[java.lang.String, java.lang.String], /) -> int: ...
    @typing.overload
    def playEarcon(self, earcon: str | java.lang.String, queueMode: int | java.jint | java.lang.Integer, params: android.os.Bundle, utteranceId: str | java.lang.String, /) -> int: ...
    def playSilence(self, durationInMs: int | java.jlong | java.lang.Long, queueMode: int | java.jint | java.lang.Integer, params: java.util.HashMap[java.lang.String, java.lang.String], /) -> int: ...
    def playSilentUtterance(self, durationInMs: int | java.jlong | java.lang.Long, queueMode: int | java.jint | java.lang.Integer, utteranceId: str | java.lang.String, /) -> int: ...
    def setAudioAttributes(self, audioAttributes: android.media.AudioAttributes, /) -> int: ...
    def setEngineByPackageName(self, enginePackageName: str | java.lang.String, /) -> int: ...
    def setLanguage(self, loc: java.util.Locale, /) -> int: ...
    def setOnUtteranceCompletedListener(self, listener: TextToSpeech.OnUtteranceCompletedListener, /) -> int: ...
    def setOnUtteranceProgressListener(self, listener: UtteranceProgressListener, /) -> int: ...
    def setPitch(self, pitch: float | java.jfloat | java.lang.Float, /) -> int: ...
    def setSpeechRate(self, speechRate: float | java.jfloat | java.lang.Float, /) -> int: ...
    def setVoice(self, voice: Voice, /) -> int: ...
    def shutdown(self) -> None: ...
    @typing.overload
    def speak(self, text: str | java.lang.String, queueMode: int | java.jint | java.lang.Integer, params: java.util.HashMap[java.lang.String, java.lang.String], /) -> int: ...
    @typing.overload
    def speak(self, text: java.lang.CharSequence, queueMode: int | java.jint | java.lang.Integer, params: android.os.Bundle, utteranceId: str | java.lang.String, /) -> int: ...
    def stop(self) -> int: ...
    @typing.overload
    def synthesizeToFile(self, text: str | java.lang.String, params: java.util.HashMap[java.lang.String, java.lang.String], filename: str | java.lang.String, /) -> int: ...
    @typing.overload
    def synthesizeToFile(self, text: java.lang.CharSequence, params: android.os.Bundle, fileDescriptor: android.os.ParcelFileDescriptor, utteranceId: str | java.lang.String, /) -> int: ...
    @typing.overload
    def synthesizeToFile(self, text: java.lang.CharSequence, params: android.os.Bundle, file: java.io.File, utteranceId: str | java.lang.String, /) -> int: ...

    class OnUtteranceCompletedListener(java.lang.Object):
        def onUtteranceCompleted(self, arg1: str | java.lang.String, /) -> None: ...

    class OnInitListener(java.lang.Object):
        def onInit(self, arg1: int | java.jint | java.lang.Integer, /) -> None: ...

    class EngineInfo(java.lang.Object):
        icon: int = ...
        label: str = ...
        name: str = ...
        def __init__(self) -> None: ...
        def toString(self) -> str: ...

    class Engine(java.lang.Object):
        ACTION_CHECK_TTS_DATA: typing.ClassVar[str] = ...
        ACTION_GET_SAMPLE_TEXT: typing.ClassVar[str] = ...
        ACTION_INSTALL_TTS_DATA: typing.ClassVar[str] = ...
        ACTION_TTS_DATA_INSTALLED: typing.ClassVar[str] = ...
        CHECK_VOICE_DATA_BAD_DATA: typing.ClassVar[int] = ...
        CHECK_VOICE_DATA_FAIL: typing.ClassVar[int] = ...
        CHECK_VOICE_DATA_MISSING_DATA: typing.ClassVar[int] = ...
        CHECK_VOICE_DATA_MISSING_VOLUME: typing.ClassVar[int] = ...
        CHECK_VOICE_DATA_PASS: typing.ClassVar[int] = ...
        DEFAULT_STREAM: typing.ClassVar[int] = ...
        EXTRA_AVAILABLE_VOICES: typing.ClassVar[str] = ...
        EXTRA_CHECK_VOICE_DATA_FOR: typing.ClassVar[str] = ...
        EXTRA_SAMPLE_TEXT: typing.ClassVar[str] = ...
        EXTRA_TTS_DATA_INSTALLED: typing.ClassVar[str] = ...
        EXTRA_UNAVAILABLE_VOICES: typing.ClassVar[str] = ...
        EXTRA_VOICE_DATA_FILES: typing.ClassVar[str] = ...
        EXTRA_VOICE_DATA_FILES_INFO: typing.ClassVar[str] = ...
        EXTRA_VOICE_DATA_ROOT_DIRECTORY: typing.ClassVar[str] = ...
        INTENT_ACTION_TTS_SERVICE: typing.ClassVar[str] = ...
        KEY_FEATURE_EMBEDDED_SYNTHESIS: typing.ClassVar[str] = ...
        KEY_FEATURE_NETWORK_RETRIES_COUNT: typing.ClassVar[str] = ...
        KEY_FEATURE_NETWORK_SYNTHESIS: typing.ClassVar[str] = ...
        KEY_FEATURE_NETWORK_TIMEOUT_MS: typing.ClassVar[str] = ...
        KEY_FEATURE_NOT_INSTALLED: typing.ClassVar[str] = ...
        KEY_PARAM_PAN: typing.ClassVar[str] = ...
        KEY_PARAM_SESSION_ID: typing.ClassVar[str] = ...
        KEY_PARAM_STREAM: typing.ClassVar[str] = ...
        KEY_PARAM_UTTERANCE_ID: typing.ClassVar[str] = ...
        KEY_PARAM_VOLUME: typing.ClassVar[str] = ...
        SERVICE_META_DATA: typing.ClassVar[str] = ...
        def __init__(self, this_0: TextToSpeech, /) -> None: ...

class TextToSpeechService(android.app.Service):
    def __init__(self) -> None: ...
    def onBind(self, intent: android.content.Intent, /) -> android.os.IBinder: ...
    def onCreate(self) -> None: ...
    def onDestroy(self) -> None: ...
    def onGetDefaultVoiceNameFor(self, lang: str | java.lang.String, country: str | java.lang.String, variant: str | java.lang.String, /) -> str: ...
    def onGetFeaturesForLanguage(self, lang: str | java.lang.String, country: str | java.lang.String, variant: str | java.lang.String, /) -> java.util.Set[java.lang.String]: ...
    def onGetLanguage(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def onGetVoices(self) -> java.util.List[Voice]: ...
    def onIsLanguageAvailable(self, arg1: str | java.lang.String, arg2: str | java.lang.String, arg3: str | java.lang.String, /) -> int: ...
    def onIsValidVoiceName(self, voiceName: str | java.lang.String, /) -> int: ...
    def onLoadLanguage(self, arg1: str | java.lang.String, arg2: str | java.lang.String, arg3: str | java.lang.String, /) -> int: ...
    def onLoadVoice(self, voiceName: str | java.lang.String, /) -> int: ...
    def onStop(self) -> None: ...
    def onSynthesizeText(self, arg1: SynthesisRequest, arg2: SynthesisCallback, /) -> None: ...

class UtteranceProgressListener(java.lang.Object):
    def __init__(self) -> None: ...
    def onAudioAvailable(self, utteranceId: str | java.lang.String, audio: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def onBeginSynthesis(self, utteranceId: str | java.lang.String, sampleRateInHz: int | java.jint | java.lang.Integer, audioFormat: int | java.jint | java.lang.Integer, channelCount: int | java.jint | java.lang.Integer, /) -> None: ...
    def onDone(self, arg1: str | java.lang.String, /) -> None: ...
    @typing.overload
    def onError(self, arg1: str | java.lang.String, /) -> None: ...
    @typing.overload
    def onError(self, utteranceId: str | java.lang.String, errorCode: int | java.jint | java.lang.Integer, /) -> None: ...
    def onRangeStart(self, utteranceId: str | java.lang.String, start: int | java.jint | java.lang.Integer, end: int | java.jint | java.lang.Integer, frame: int | java.jint | java.lang.Integer, /) -> None: ...
    def onStart(self, arg1: str | java.lang.String, /) -> None: ...
    def onStop(self, utteranceId: str | java.lang.String, interrupted: bool | java.jboolean | java.lang.Boolean, /) -> None: ...

class Voice(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[Voice]] = ...
    LATENCY_HIGH: typing.ClassVar[int] = ...
    LATENCY_LOW: typing.ClassVar[int] = ...
    LATENCY_NORMAL: typing.ClassVar[int] = ...
    LATENCY_VERY_HIGH: typing.ClassVar[int] = ...
    LATENCY_VERY_LOW: typing.ClassVar[int] = ...
    QUALITY_HIGH: typing.ClassVar[int] = ...
    QUALITY_LOW: typing.ClassVar[int] = ...
    QUALITY_NORMAL: typing.ClassVar[int] = ...
    QUALITY_VERY_HIGH: typing.ClassVar[int] = ...
    QUALITY_VERY_LOW: typing.ClassVar[int] = ...
    def __init__(self, name: str | java.lang.String, locale: java.util.Locale, quality: int | java.jint | java.lang.Integer, latency: int | java.jint | java.lang.Integer, requiresNetworkConnection: bool | java.jboolean | java.lang.Boolean, features: java.util.Set[java.lang.String], /) -> None: ...
    def describeContents(self) -> int: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getFeatures(self) -> java.util.Set[java.lang.String]: ...
    def getLatency(self) -> int: ...
    def getLocale(self) -> java.util.Locale: ...
    def getName(self) -> str: ...
    def getQuality(self) -> int: ...
    def hashCode(self) -> int: ...
    def isNetworkConnectionRequired(self) -> bool: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...
