Sound

abstract class Sound(val creationCoroutineContext: CoroutineContext) : SoundProps, AudioStreamable

Inheritors

Constructors

Link copied to clipboard
constructor(creationCoroutineContext: CoroutineContext)

Properties

Link copied to clipboard
open val length: TimeSpan
Link copied to clipboard
open val name: String
Link copied to clipboard
open val nchannels: Int
Link copied to clipboard
open override var panning: Double
Link copied to clipboard
open override var pitch: Double
Link copied to clipboard
open override var volume: Double

Functions

Link copied to clipboard
abstract suspend fun decode(maxSamples: Int = DEFAULT_MAX_SAMPLES): AudioData
Link copied to clipboard
suspend fun play(params: PlaybackParameters = PlaybackParameters.DEFAULT): SoundChannel
suspend fun play(times: PlaybackTimes, startTime: TimeSpan = 0.seconds): SoundChannel
open fun play(coroutineContext: CoroutineContext, params: PlaybackParameters = PlaybackParameters.DEFAULT): SoundChannel
fun play(coroutineContext: CoroutineContext, times: PlaybackTimes, startTime: TimeSpan = 0.seconds): SoundChannel
Link copied to clipboard
suspend fun playAndWait(params: PlaybackParameters, progress: SoundChannel.(TimeSpan, TimeSpan) -> Unit = { current, total -> })
suspend fun playAndWait(times: PlaybackTimes = 1.playbackTimes, startTime: TimeSpan = 0.seconds, progress: SoundChannel.(TimeSpan, TimeSpan) -> Unit = { current, total -> })
Link copied to clipboard
suspend fun playForever(startTime: TimeSpan = 0.seconds): SoundChannel
fun playForever(coroutineContext: CoroutineContext, startTime: TimeSpan = 0.seconds): SoundChannel
Link copied to clipboard
fun playNoCancel(times: PlaybackTimes = PlaybackTimes.ONE, startTime: TimeSpan = 0.seconds): SoundChannel
Link copied to clipboard
fun playNoCancelForever(startTime: TimeSpan = 0.seconds): SoundChannel
Link copied to clipboard
suspend fun toAudioData(maxSamples: Int = DEFAULT_MAX_SAMPLES): AudioData
Link copied to clipboard
open suspend override fun toStream(): AudioStream
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard
suspend fun AudioStreamable.withEcho(bufferLen: Int = 2048, config: AudioStreamEchoConfig = AudioStreamEchoConfig()): Sound
Link copied to clipboard
suspend fun AudioStreamable.withProcessor(block: suspend (inp: AudioStream, outp: AudioSamplesDeque) -> Unit): Sound