audiojs / contributing

Discussion and guidelines for contributing
2 stars 0 forks source link

audio-load #38

Open dy opened 7 years ago

dy commented 7 years ago

Related to https://github.com/audiojs/audio-loader/issues/7#issuecomment-248918984 and https://github.com/dfcreative/app-audio.

Since we have freesound API, we could write a component reading any URL with optional token and returning arraybuffer with (encoded) data.

Like

let load = require('audio-load'),
    decode = require('audio-decode'),
    play = require('audio-play')

load('https://www.freesound.org/people/Sirkoto51/sounds/274153/')
    .then(decode)
    .then(play) 

That would allow for audio to load files easily as well:

let Audio = require('audio')

Audio.load('https://www.freesound.org/people/Sirkoto51/sounds/274153/', {token: xxx}).then(audio => audio.play())

APIs we could enable: