mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 19:10:39 +00:00
17 lines
502 B
Swift
17 lines
502 B
Swift
import Foundation
|
|
|
|
@MainActor
|
|
public protocol StreamingAudioPlaying {
|
|
func play(stream: AsyncThrowingStream<Data, Error>) async -> StreamingPlaybackResult
|
|
func stop() -> Double?
|
|
}
|
|
|
|
@MainActor
|
|
public protocol PCMStreamingAudioPlaying {
|
|
func play(stream: AsyncThrowingStream<Data, Error>, sampleRate: Double) async -> StreamingPlaybackResult
|
|
func stop() -> Double?
|
|
}
|
|
|
|
extension StreamingAudioPlayer: StreamingAudioPlaying {}
|
|
extension PCMStreamingAudioPlayer: PCMStreamingAudioPlaying {}
|