-
Notifications
You must be signed in to change notification settings - Fork 203
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
Switch from Audio to AudioContext to play music #128
Comments
@KeitIG if we're going to use This becomes especially important for Something like:
|
@KeitIG how do you expect this to happen? If I'm going to do this, you're expecting the PR with specs and without regressions, right? |
@YurySolovyov I've updated the specs. "Basically", the things is to rewrite |
A few more things:
|
@KeitIG
Where we can do any number of releases between the steps. |
This issue is just about |
Added events specs. |
is it really necessary to get rid of HTML5 audio though? it can still be used with the web audio API using it's so much easier to control playback with HTML5 audio than it is with the web audio API. however, if you somehow want to convert and stream tracks from ffmpeg you'd probably have to use web audio API only... unless you first convert the entire audio file temporarily to disk but it gets tricky. |
That's what was planned. When I say "drop HTML element", I'm speaking about the whole player system, not the things that play/decode music. This may change in the future though if we decide to use |
@bodyflex @KeitIG it seems like if we just do the simplest thing possible to replace For ffmpeg it would be useful to employ chinked encoding to avoid converting the whole file at once. For other stuff, I'm not sure what benefit we can get from WebAudio at this point, though I think it is still important. |
All the issues depending on this ? (equalizer, crossfade ...) |
For what it's worth, AudioContext.createAnalyser() could be used to create equalizer-like effects as in these examples. |
I've effectively implemented this in https://github.com/s0/museeks/blob/synesthesia/src/ui/lib/player.ts, as part of the work towards #31 (see #31 (comment)). Hopefully I'll soon have a PR open that will address this issue and #31. |
PreciseAudio provides an API for gapless playback, and presents mostly the same interface as Audio, so switching to this library didn't require too many changes, and paves the way for martpie#31 PreciseAudio also uses an AudioContext internally, and makes the audio graph available for mutation via getAudioNodes(), which will allow for features such as equalizers (martpie#127) or visualizers / analyzers. Fixes martpie#128
last edit: november 30th 2016 (specs added)
The
Audio
media element works well, but we need the power ofAudioContext
to add effects, play without interruptions, easy cross fade ect.That's a huge work.
Tasks
Those are hints on how to accomplish this, these may change depending of our needs. More over, they more explain how "a player work" than "how it should be done"
lib/player.js
Interface (already existing)play()
pause()
stop()
mute()
unmute()
setAudioVolume()
setAudioPlaybackRate()
setAudioSrc()
)setAudioCurrentTime()
)player.js
play
: new track is being playedpause
: the whole thing is pausedended
: the track endedtimeupdate
: same thanHtmlMediaElement
error
: means what it meansHints
lib/player.js
can use Audio tags as they can be used as sources forAudioContext
Help
This issue is required to eventually do #127 #31 #114
The text was updated successfully, but these errors were encountered: