AutoCat/AutoCatCore/Services/AudioRecordService/AudioRecordServiceProtocol.swift
2025-03-16 22:23:03 +03:00

27 lines
702 B
Swift

//
// AudioRecordServiceProtocol.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 11.03.2025.
// Copyright © 2025 Selim Mustafaev. All rights reserved.
//
import Speech
import Mockable
@Mockable
public protocol AudioRecordServiceProtocol: Sendable {
@discardableResult
func requestRecordPermissions() async -> Bool
@discardableResult
func requestRecognitionAuthorization() async -> SFSpeechRecognizerAuthorizationStatus
func startRecording(to url: URL) async throws
func stopRecording() async
func cancelRecording() async
func recognizeText(from url: URL) async -> String?
func getDuration(from url: URL) async throws -> TimeInterval
}