admin管理员组

文章数量:1357307

Is there a way to change the playback speed of audio in the browser? What is best to acplish this task, html5 audio, or flash, or something else? Are there any specific libraries that would help with this?

Is there a way to change the playback speed of audio in the browser? What is best to acplish this task, html5 audio, or flash, or something else? Are there any specific libraries that would help with this?

Share Improve this question asked Mar 8, 2013 at 8:49 pepperpepper 2,1975 gold badges26 silver badges31 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Use the Web Audio API.

In the following code I answered your other question.

best way to loop audio in the browser?

Modify the code in my answer above as follows for a playback speed example.

Right below

source.loop = loopOnOff;

add

source.playbackRate.value = 1; // change number to between 0.10 to 10 (or larger/smaller) to test.

You can also run the html audio tag through the web audio api and add effects processing.

Interesting question there,

HTMl5 will have player speed control will have speed control..

A couple of noteworthy uping features are playbackRate and defaultPlaybackRate. As you can probably imagine, these fellas let us alter the speed and direction of playback. This functionality could be used for fast-forward and rewind functions or perhaps to allow users to tweak the playback speed so they can fit more podcasts into their day.

audio.playbackRate returns 1 at normal speed and acts as a multiple that is applied to the rate of playback. For example, setting playbackRate to 2 would double the speed, while setting it to -1 would play the media backwards. audio.defaultPlaybackRate is the rate at which the audio will play after you pause and restart the media (or issue any event for that matter).


Flash Player may help( but it will be customized one you may create, with stream buffer, you need to define the player speed once buffer has the content to play.

Sound easy but will take a lot effort, Refer VLC opesource for better Idea, its documented with ffmpeg which works with Audio, and works with client software, in browser ti will be heavy, refer Just to have idea.

I hope this may help :)

本文标签: javascriptvariable speed control for audio playback in the browserStack Overflow