//sorisdk/com.iplateia.sorisdk/SORIAudioRecognitionService
SORIAudioRecognitionService
open class SORIAudioRecognitionService : Service
Foreground service that handles audio recognition tasks with network resilience support.
This service manages the audio recognition process, running in the foreground to ensure continuous operation. It includes comprehensive network handling capabilities to queue and retry failed requests when network connectivity is unavailable.
Key Features
- Foreground Operation: Runs as a foreground service with user notification
- Audio Recognition: Processes audio input to detect recognized materials
- Network Resilience: Automatically queues failed requests when network is unavailable
- Automatic Retry: Processes queued requests when network connectivity is restored
- Android 15 Support: Handles time limits for foreground services on Android 15+
Network Handling
The service monitors network connectivity and automatically manages request queuing:
- Failed requests due to network issues are queued based on configuration
- Network state changes trigger automatic processing of pending requests
- Expired requests (older than configured timeout) are automatically discarded
Broadcasts
The service sends the following broadcast intents:
Actions.CAMPAIGN_FOUND
: When a campaign is successfully retrievedActions.NETWORK_ERROR
: When a network error occurs during processingActions.REQUEST_QUEUED
: When a request is queued for later delivery
Since
1.0.0
See also
SORIConfig | for configuration options |
PendingRequestManager | for request queue management |
NetworkUtils | for network availability checking |
Constructors
SORIAudioRecognitionService | [androidJvm] constructor() |
Types
Name | Summary |
---|---|
Companion | [androidJvm] object Companion |
LocalBinder | [androidJvm] inner class LocalBinder : Binder |
Properties
Name | Summary |
---|---|
api | [androidJvm] lateinit var api: SORIApiClient |
CHANNEL_ID | [androidJvm] val CHANNEL_ID: String |
matcher | [androidJvm] lateinit var matcher: AfpMatcher |
notificationChannel | [androidJvm] lateinit var notificationChannel: NotificationChannel |