Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio-play #23

Closed
dy opened this issue Sep 9, 2016 · 0 comments
Closed

audio-play #23

dy opened this issue Sep 9, 2016 · 0 comments

Comments

@dy
Copy link
Member

dy commented Sep 9, 2016

We need simple component for easy audio-buffer previews, I suggest the folllowing API:

const play = require('audio-play');

//play audio buffer with possible options
let playback = play(audioBuffer, {
    //repeat - bool or number for exact number of repeats
    repeat: false,

    //start/end time, can be negative
    start: 0,
    end: -0,

    //playback rate
    rate: 1,

    //fine-tune of playback rate, in cents
    detune: 0,

    //volume
    volume: 1,

    //possibly existing audio-context, not necessary
    context: require('audio-context'),

    //start playing immediately
    autoplay: true
});

//pause/continue playback
playback.pause();
playback.play();

//or just 
let play = playback, pause;
pause = play();
play = pause();

The component is eventually will be used by audiojs/audio.

The problem is that audio-play is taken by former play-audio, whereas play-audio is free-like.

I am going to write to @npm and @deathcap to resolve this, if possible, to make swapping.

This was referenced Sep 9, 2016
@dy dy closed this as completed Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant