Trait

org.scalajs.dom.raw

AudioBuffer

Related Doc: package raw

Permalink

trait AudioBuffer extends Object

The AudioBuffer interface represents a short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode.

Objects of these types are designed to hold small audio snippets, typically less than 45 s. For longer sounds, objects implementing the MediaElementAudioSourceNode are more suitable.

The buffer contains data in the following format: non-interleaved IEEE754 32-bit linear PCM with a nominal range between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. If the AudioBuffer has multiple channels, they are stored in separate buffer.

Annotations
@RawJSType() @native()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AudioBuffer
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def copyFromChannel(destination: Float32Array, channelNumber: Int, startInChannel: Int): Unit

    Permalink

    Copies the samples from the specified channel of the AudioBuffer to the destination array.

    Copies the samples from the specified channel of the AudioBuffer to the destination array.

    destination

    A Float32Array to copy the channel data to.

    channelNumber

    The channel number of the current AudioBuffer to copy the channel data from. If channelNumber is greater than or equal to AudioBuffer.numberOfChannels, an INDEX_SIZE_ERR will be thrown.

    startInChannel

    An optional offset to copy the data from. If startInChannel is greater than AudioBuffer.length, an INDEX_SIZE_ERR will be thrown.

  7. def copyToChannel(source: Float32Array, channelNumber: Int, startInChannel: Int): Unit

    Permalink

    Copies the samples to the specified channel of the AudioBuffer, from the source array.

    Copies the samples to the specified channel of the AudioBuffer, from the source array.

    source

    A Float32Array that the channel data will be copied from.

    channelNumber

    The channel number of the current AudioBuffer to copy the channel data to. If channelNumber is greater than or equal to AudioBuffer.numberOfChannels, an INDEX_SIZE_ERR will be thrown.

    startInChannel

    An optional offset to copy the data to. If startInChannel is greater than AudioBuffer.length, an INDEX_SIZE_ERR will be thrown.

  8. val duration: Double

    Permalink

    Returns a double representing the duration, in seconds, of the PCM data stored in the buffer.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def getChannelData(channel: Int): Float32Array

    Permalink

    Returns a Float32Array containing the PCM data associated with the channel, defined by the channel parameter (with 0 representing the first channel).

    Returns a Float32Array containing the PCM data associated with the channel, defined by the channel parameter (with 0 representing the first channel).

    channel

    The channel property is an index representing the particular channel to get data for. An index value of 0 represents the first channel. If the channel index value is greater than of equal to AudioBuffer.numberOfChannels, an INDEX_SIZE_ERR exception will be thrown.

  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  18. val length: Int

    Permalink

    Returns an integer representing the length, in sample-frames, of the PCM data stored in the buffer.

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. val numberOfChannels: Int

    Permalink

    Returns an integer representing the number of discrete audio channels described by the PCM data stored in the buffer.

  23. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  24. val sampleRate: Double

    Permalink

    Returns a float representing the sample rate, in samples per second, of the PCM data stored in the buffer.

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped