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.

Attributes

duration

duration of this audio wave in seconds

wave

audio wave storing this clip

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

Members list

Concise view

Value members

Concrete methods

Appends an AudioClip to this one

Appends an AudioClip to this one

Attributes

def byteIterator(sampleRate: Double): Iterator[Byte]

Samples this wave at the specified sample rate and returns an iterator of Bytes in the [-127, 127] range.

Samples this wave at the specified sample rate and returns an iterator of Bytes in the [-127, 127] range.

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

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

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

Flatmaps the wave of this clip. The duration stays unchanged

Flatmaps the wave of this clip. The duration stays unchanged

Attributes

Gets the amplitude at a certain point in time

Gets the amplitude at a certain point in time

Attributes

t

time in seconds

Returns:

amplitude

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.

Attributes

t

time in seconds

Returns:

amplitude

def iterator(sampleRate: Double): Iterator[Double]

Samples this wave at the specified sample rate and returns an iterator of Doubles in the [-1, 1] range.

Samples this wave at the specified sample rate and returns an iterator of Doubles in the [-1, 1] range.

Attributes

Maps the values of this wave.

Maps the values of this wave.

Attributes

def numSamples(sampleRate: Double): Int

Returns the number of samples required to store this wave at a certain sample rate.

Returns the number of samples required to store this wave at a certain sample rate.

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

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

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

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product