AudioClip

eu.joaocosta.minart.audio.AudioClip
See theAudioClip companion object
final case class AudioClip(wave: AudioWave, duration: Double)

Audio Clip represented by a wave and a duration.

Value parameters

duration

duration of this audio wave in seconds

wave

audio wave storing this clip

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type

Members list

Value members

Concrete methods

def append(that: AudioClip): AudioClip

Appends an AudioClip to this one

Appends an AudioClip to this one

Attributes

def changeSpeed(multiplier: Double): AudioClip

Speeds up/down this clip according to a multiplier

Speeds up/down this clip according to a multiplier

Attributes

Returns an audio wave that clamps this clip when out of bounds

Returns an audio wave that clamps this clip when out of bounds

Attributes

def coflatMap(f: AudioClip => Double): AudioClip

Coflatmaps this clip with a AudioClip => Double function. Effectively, each sample of the new clip is computed from a translated clip, which can be used to implement convolutions.

Coflatmaps this clip with a AudioClip => Double function. Effectively, each sample of the new clip is computed from a translated clip, which can be used to implement convolutions.

Attributes

def contramap(f: Double => Double): AudioWave

Contramaps the values of the wave of this clip

Contramaps the values of the wave of this clip

Attributes

def drop(time: Double): AudioClip

Returns a new Audio Clip without the first time seconds of this audio clip

Returns a new Audio Clip without the first time seconds of this audio clip

Attributes

def flatMap(f: Double => AudioWave): AudioClip

Flatmaps the wave of this clip. The duration stays unchanged

Flatmaps the wave of this clip. The duration stays unchanged

Attributes

def getAmplitude(t: Double): Option[Double]

Gets the amplitude at a certain point in time

Gets the amplitude at a certain point in time

Value parameters

t

time in seconds

Attributes

Returns

amplitude

def getAmplitudeOrElse(t: Double, fallback: Double): Double

Gets the amplitude at a certain point in time, falling back to a default value when out of bounds. Similar to getAmplitude(t).getOrElse(fallback), but avoids an allocation.

Gets the amplitude at a certain point in time, falling back to a default value when out of bounds. Similar to getAmplitude(t).getOrElse(fallback), but avoids an allocation.

Value parameters

t

time in seconds

Attributes

Returns

amplitude

def map(f: Double => Double): AudioClip

Maps the values of this wave.

Maps the values of this wave.

Attributes

Returns an audio wave that repeats this clip forever

Returns an audio wave that repeats this clip forever

Attributes

def repeating(times: Int): AudioClip

Returns an audio wave that repeats this clip a certain number of times

Returns an audio wave that repeats this clip a certain number of times

Attributes

Returns a reversed version of this wave

Returns a reversed version of this wave

Attributes

def take(time: Double): AudioClip

Returns a new Audio Clip with the first time seconds of this audio clip

Returns a new Audio Clip with the first time seconds of this audio clip

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def zipWith(that: AudioClip, f: (Double, Double) => Double): AudioClip

Combines this clip with another by combining their values using the given function.

Combines this clip with another by combining their values using the given function.

Attributes

def zipWith(that: AudioWave, f: (Double, Double) => Double): AudioClip

Combines this clip with a wave by combining their values using the given function.

Combines this clip with a wave by combining their values using the given function.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product