BB.AudioBufferLoader

A module for creating audio buffers from audio files

Index

Properties

Methods

Constructor

BB.AudioBufferLoader
(
  • config
  • [callback]
)

Parameters:

  • config Object

    A config object to initialize the buffer ( context:AudioContext, paths: Array of file paths, autoload:boolean)

  • [callback] Function optional

    A callback, with a buffer Object

Example:


 BB.Audio.init();

 // one way to do it
 var loader = new BB.AudioBufferLoader({
    paths: ['audio/katy.ogg','audio/entro.ogg']
 }, function(buffers){
    console.log('loaded:', buffers )
 });

 // another way to do it
 loader = new BB.AudioBufferLoader({
    context:BB.Audio.context,
    paths:['katy.ogg','entro.ogg'],
    autoload:false
 });
 loader.load(); // call load later, ex under some other condition

view basic BB.AudioBufferLoader example

Properties

buffers Array

audio buffers array, accessible in callback

urls Array

array of paths to audio files to load

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

load ()

creates buffers from url paths set in the constructor, automatically runs in constructor unless autoload is set to false ( in the config )

loadbuffer
(
  • path
  • index
)
protected

private function used by load() to load a buffer

Parameters:

  • path String

    to audio file

  • index Number

    of buffer

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index