Package-level declarations

Types

Link copied to clipboard
external class AudioBuffer
Link copied to clipboard
class AudioBufferOrHTMLMediaElement(val audioBuffer: AudioBuffer?, val htmlAudioElement: HTMLAudioElement?)
Link copied to clipboard
class AudioBufferSound(val buffer: AudioBufferOrHTMLMediaElement, val url: String, coroutineContext: CoroutineContext, val name: String = "unknown") : Sound
Link copied to clipboard
Link copied to clipboard
class AudioChannel(val nativeSoundProvider: NativeSoundProvider = korlibs.audio.sound.nativeSoundProvider)
Link copied to clipboard
Link copied to clipboard
class AudioData(val rate: Int, val samples: AudioSamples)
Link copied to clipboard
Link copied to clipboard
external interface AudioDestinationNode : AudioNode
Link copied to clipboard
external interface AudioNode
Link copied to clipboard
external interface AudioParam
Link copied to clipboard
external class AudioProcessingEvent : Event
Link copied to clipboard
class AudioSamples(val channels: Int, val totalSamples: Int, val data: Array<ShortArray> = Array(channels) { ShortArray(totalSamples) }) : IAudioSamples
Link copied to clipboard
class AudioSamplesDeque(val channels: Int)
Link copied to clipboard
class AudioSamplesInterleaved(val channels: Int, val totalSamples: Int, val data: ShortArray = ShortArray(totalSamples * channels)) : IAudioSamples
Link copied to clipboard
class AudioSamplesProcessor(val channels: Int, val totalSamples: Int, val data: Array<FloatArray> = Array(channels) { FloatArray(totalSamples) })
Link copied to clipboard
external interface AudioScheduledSourceNode : AudioNode
Link copied to clipboard
abstract class AudioStream(val rate: Int, val channels: Int) : AudioStreamable, Closeable
Link copied to clipboard
interface AudioStreamable
Link copied to clipboard
object AudioTone
Link copied to clipboard
open external class BaseAudioContext
Link copied to clipboard
class CoreAudioGenerator(val sampleRate: Int, val nchannels: Int, val numBuffers: Int = 3, val bufferSize: Int = 4096, val coroutineContext: CoroutineContext, val generatorCore: CoreAudioGenerator.(data: CPointer<ShortVar>, dataSize: Int) -> Unit) : MyCoreAudioOutputCallback
Link copied to clipboard
Link copied to clipboard
open class DequeBasedPlatformAudioOutput(val coroutineContext: CoroutineContext, val frequency: Int) : PlatformAudioOutput
Link copied to clipboard
class DummySoundChannel(val sound: Sound, val data: AudioData? = null) : SoundChannel
Link copied to clipboard
Link copied to clipboard
external interface GainNode : AudioNode
Link copied to clipboard
Link copied to clipboard
interface IAudioSamples
Link copied to clipboard
class JsNewPlatformAudioOutput(val coroutineContext: CoroutineContext, nchannels: Int, val frequency: Int, gen: (AudioSamplesInterleaved) -> Unit) : NewPlatformAudioOutput
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class NewPlatformAudioOutput(val coroutineContext: CoroutineContext, val channels: Int, val frequency: Int, gen: (AudioSamplesInterleaved) -> Unit) : Disposable, SoundProps
Link copied to clipboard
external interface PannerNode : AudioNode
Link copied to clipboard
open class PlatformAudioOutput(val coroutineContext: CoroutineContext, val frequency: Int) : Disposable, SoundProps
Link copied to clipboard
open class PlatformAudioOutputBasedOnNew(val soundProvider: NativeSoundProvider, val coroutineContext: CoroutineContext, val frequency: Int) : DequeBasedPlatformAudioOutput
Link copied to clipboard
data class PlaybackParameters(val times: PlaybackTimes = 1.playbackTimes, val startTime: TimeSpan = 0.seconds, val bufferTime: TimeSpan = 0.16.seconds, val volume: Double = 1.0, val pitch: Double = 1.0, val panning: Double = 0.0, val onCancel: () -> Unit? = null, val onFinish: () -> Unit? = null) : ReadonlySoundProps
Link copied to clipboard
inline class PlaybackTimes(val count: Int)
Link copied to clipboard
Link copied to clipboard
external interface ScriptProcessorNode : AudioNode
Link copied to clipboard
abstract class Sound(val creationCoroutineContext: CoroutineContext) : SoundProps, AudioStreamable
Link copied to clipboard
class SoundAudioData(coroutineContext: CoroutineContext, val audioData: AudioData, var soundProvider: NativeSoundProvider, val closeStream: Boolean = false, val name: String = "Unknown", val onComplete: suspend () -> Unit? = null) : Sound
Link copied to clipboard
class SoundAudioStream(coroutineContext: CoroutineContext, val stream: AudioStream, var soundProvider: NativeSoundProvider, val closeStream: Boolean = false, val name: String = "Unknown", val onComplete: suspend () -> Unit? = null) : Sound
Link copied to clipboard
abstract class SoundChannel(val sound: Sound) : SoundChannelBase, Extra
Link copied to clipboard
Link copied to clipboard
class SoundChannelGroup(volume: Double = 1.0, pitch: Double = 1.0, panning: Double = 0.0) : SoundChannelBase
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
object SoundUtils
Link copied to clipboard
external interface StereoPannerNode : AudioNode
Link copied to clipboard
abstract class ThreadBasedPlatformAudioOutput(val coroutineContext: CoroutineContext, val frequency: Int) : DequeBasedPlatformAudioOutput
Link copied to clipboard

Properties

Functions

Link copied to clipboard
expect fun appleInitAudio()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun SoundChannelBase.await()
suspend fun SoundChannel.await(progress: SoundChannel.(TimeSpan, TimeSpan) -> Unit = { current, total -> })
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun createAudioElement(src: String, currentTime: Double = 0.0, autoplay: Boolean = false, crossOrigin: String? = "anonymous"): Audio
Link copied to clipboard
suspend fun AudioData.encodeToFile(file: VfsFile, format: AudioFormats = defaultAudioFormats, props: AudioEncodingProps = AudioEncodingProps.DEFAULT)
Link copied to clipboard
fun AudioSamples.interleaved(out: AudioSamplesInterleaved = AudioSamplesInterleaved(channels, totalSamples)): AudioSamplesInterleaved
fun IAudioSamples.interleaved(out: AudioSamplesInterleaved = AudioSamplesInterleaved(channels, totalSamples)): AudioSamplesInterleaved
Link copied to clipboard
fun osStatusToString(status: OSStatus): String
Link copied to clipboard
suspend fun AudioStream.playAndWait(params: PlaybackParameters = PlaybackParameters.DEFAULT)
suspend fun AudioStream.playAndWait(times: PlaybackTimes = 1.playbackTimes, startTime: TimeSpan = 0.seconds, bufferTime: TimeSpan = 0.1.seconds)
Link copied to clipboard
suspend fun VfsFile.readAudioData(formats: AudioFormat = defaultAudioFormats, props: AudioDecodingProps = AudioDecodingProps.DEFAULT): AudioData
Link copied to clipboard
suspend fun VfsFile.readAudioStream(formats: AudioFormat = defaultAudioFormats + nativeSoundProvider.audioFormats, props: AudioDecodingProps = AudioDecodingProps.DEFAULT): AudioStream
Link copied to clipboard
suspend fun VfsFile.readAudioStreamOrNull(formats: AudioFormat = defaultAudioFormats + nativeSoundProvider.audioFormats, props: AudioDecodingProps = AudioDecodingProps.DEFAULT): AudioStream?
Link copied to clipboard
suspend fun VfsFile.readMusic(props: AudioDecodingProps = AudioDecodingProps.DEFAULT): Sound
suspend fun ByteArray.readMusic(props: AudioDecodingProps = AudioDecodingProps.DEFAULT): Sound
Link copied to clipboard
suspend fun VfsFile.readSound(props: AudioDecodingProps = AudioDecodingProps.DEFAULT, streaming: Boolean = false): Sound
suspend fun ByteArray.readSound(props: AudioDecodingProps = AudioDecodingProps.DEFAULT, streaming: Boolean = false): Sound
Link copied to clipboard
fun AudioSamples.resample(srcFreq: Int, dstFreq: Int): AudioSamples
Link copied to clipboard
Link copied to clipboard
fun IAudioSamples.separated(out: AudioSamples = AudioSamples(channels, totalSamples)): AudioSamples
Link copied to clipboard
suspend fun AudioStream.toData(maxSamples: Int = DEFAULT_MAX_SAMPLES): AudioData
Link copied to clipboard
suspend fun AudioData.toSound(soundProvider: NativeSoundProvider = nativeSoundProvider): Sound
suspend fun AudioStream.toSound(closeStream: Boolean = false, name: String = "Unknown"): Sound
suspend fun AudioStream.toSound(closeStream: Boolean = false, name: String = "Unknown", onComplete: suspend () -> Unit? = null): Sound
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun AudioStreamable.withProcessor(block: suspend (inp: AudioStream, outp: AudioSamplesDeque) -> Unit): Sound
Link copied to clipboard

Change the rate, changing the pitch and the duration of the sound.

Link copied to clipboard
suspend fun VfsFile.writeAudio(data: AudioData, formats: AudioFormat = defaultAudioFormats + nativeSoundProvider.audioFormats, props: AudioEncodingProps = AudioEncodingProps.DEFAULT)