Directory

← Back

AudioPlayer Add-on

Headless audio player using WebAudio API to allow streaming playback of an server-side PCM data buffer. Offers server side controls and pluggable effects.

Author

Rating

Popularity

600+

AudioPlayer is an add-on for Vaadin that uses WebAudio to allow streaming playback of an arbitrary server-side PCM data buffer. Audio can be transported as WAV. It also supports server-side control of the audio playback such as audio and stereo balance, as well as advanced control via pluggable effects, such as highpass and lowpass filters.

Demo

Includes demo application that shows examples of most functionality including:

  • streaming different types of audio files
  • creating UI that connects to the audio player
  • server-side control of audio player
  • creating effect chains with pluggable effects

Installing

For more information about using the addon and/or running the demo application, see the README.md file or visit the github page: https://github.com/drewharvey/VaadinAudioPlayer

Sample code

        String filename = "somefile.wav";
        String filepath = "src/main/resources/org/vaadin/addon/audio/wav";
        // decodeToPcm method found in demo
        ByteBuffer fileBytes = decodeToPcm(filename, filepath);

        // createWaveStream method found in demo
        Stream stream = createWaveStream(fileBytes, new WaveEncoder());

        AudioPlayer player = new AudioPlayer(stream);

        // hook play button to AudioPlayer
        Button playButton = new Button("Play");
        playButton.addClickListener(buttonClickEvent -> {
            if (player.isStopped()) {
                player.play();
            } else if (player.isPaused()) {
                player.resume();
            }
        });

        add(player, playButton);

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

The add-on has been updated to Polymer3.

You can now use this add-on in Vaadin 14 without the compatibility mode.

If your project is running in Vaadin 14 compatibility mode, please use the version 2.0.2

Released
2020-09-11
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 14+
Polymer 3.0+
Vaadin 24 in 4.0.0
Polymer 2.0+ in 2.0.2
Vaadin 14 in 3.1.0
Vaadin 7.7+ in 1.3
Browser
Firefox
Safari
Google Chrome
Internet Explorer

AudioPlayer Add-on - Vaadin Add-on Directory

Headless audio player using WebAudio API to allow streaming playback of an server-side PCM data buffer. Offers server side controls and pluggable effects. AudioPlayer Add-on - Vaadin Add-on Directory
AudioPlayer is an add-on for Vaadin that uses WebAudio to allow streaming playback of an arbitrary server-side PCM data buffer. Audio can be transported as WAV. It also supports server-side control of the audio playback such as audio and stereo balance, as well as advanced control via pluggable effects, such as highpass and lowpass filters. ### Demo ### Includes demo application that shows examples of most functionality including: * streaming different types of audio files * creating UI that connects to the audio player * server-side control of audio player * creating effect chains with pluggable effects ### Installing ### For more information about using the addon and/or running the demo application, see the README.md file or visit the github page: https://github.com/drewharvey/VaadinAudioPlayer
Github

AudioPlayer Add-on version 1.0

AudioPlayer Add-on version 1.1
Fixes issue with package name mismatch.

AudioPlayer Add-on version 1.2

AudioPlayer Add-on version 1.3
### Version 1.3 - Reduced chunk overlap to 50ms for more accurate timing - Fixed bug in setPosition(..) - Miscellaneous fixes in demo application Fixes since 1.1 - Improved pause - resume logic, and skip to position behavior - Add option to configure position reporting interval - Adding an api (also JavaScript) to set position of audio player - Fixes in audio chunck logic during playback

AudioPlayer Add-on version 2.0
V14 test version.

AudioPlayer Add-on version 2.0.1
V14 compatibility mode (Polyme 2 + Bower) release.

AudioPlayer Add-on version 2.0.2

AudioPlayer Add-on version 3.0.0
The add-on has been updated to Polymer3. You can now use this add-on in Vaadin 14 without the compatibility mode. If your project is running in Vaadin 14 compatibility mode, please use the version 2.0.2

AudioPlayer Add-on version 3.0.1
Fix a javascript error on pause. See https://github.com/parttio/VaadinAudioPlayer/issues/3

AudioPlayer Add-on version 3.0.2
Java 8 compatibility (previously build with a higher JDK)

AudioPlayer Add-on version 3.1.0
### Version 3.1.0 - Added range support

AudioPlayer Add-on version 4.0.0
Vaadin 24 version of the addon. Removed PolymerTemplate usage.

Online