PION
? What is PION?
PION is an acronym for
Plug-In Over Network.
It is a paradigm for creating cross-platform plug-ins.
Most audio, video, and image editing software support adding additional features and effects by using plug-ins.
Usually these plug-ins need to be redeveloped for a specific platform such as Windows, Mac, Linux, Android, or iOS. Mobile platforms
have many restrictions and technical challenges making traditional plug-ins impossible or
needlessly complicated to develop. The PION paradigm is a way to develop plug-ins that can be used on
every platform, are simple to make, have little administrative overhead, and can approach native performance.
⚙ How does it work?
Plug-ins are developed using the latest web technology (primarily HTML and JavaScript or Web Assembly) and are hosted in a web browser.
The host app interacts with the plug-in through the local network. Here are the steps for hosting a plug-in:
- The host app creates an embedded web browser or web view (an external browser could be used as well).
- The host app creates a simple TCP server on 127.0.0.1 or ::1 (localhost) on an available port.
- The host app directs the web view to navigate to the plug-in's URL, appending the port number as a parameter (if not the default port), such as:
https://domain.com/plugin.html?port=7065
- The plug-in opens a WebSocket to 127.0.0.1 or ::1 (localhost) on the port provided (or the default port).
- The host and plug-in communicate through this connection to exchange information through JSON or raw data.
Ideally standard protocols would be defined for audio, video, and image processing. Multiple plug-ins could be hosted
in multiple webviews or HTML iframe elements on different ports.
+ What are the advantages?
PION has many advantages over traditional plug-in development:
- Cross-platform by design: create the plug-in once, use it on every platform.
- Faster iterative development process: just edit the HTML file and reload the effect in the host to test it.
- Potentially near native performance and support for existing C/C++ code with Web Assembly.
- No or little administrative overhead and cost: no platform account required, such as Apple Developer or Google Play
and no development tools to purchase, download, install, and maintain.
- Avoids excessively restrictive platform policies: no approval from Apple, Google or Microsoft required .
- Simple deployment: just upload to a cloud server or website and share!
- Very simple for end-users to install: just enter or copy/paste a URL (host program could search and present a list)!
- What are the disadvantages?
- Hosting is more complicated, requiring an embedded browser. However that is well supported on Android and iOS, and now on Windows with the recent Edge update.
- A constant network connection may be required. However local "file:///" and cacheable plug-ins are supported.
- Performance is decreased due to network overhead and no direct access to frame buffer memory.
! Where can I see it in action?
PION is in supported in the
GoldWave Audio Editor. Use
Options | Plug-in | Effect | Plug-in Over Network to
add plug-ins. Copy and paste the following links to add PION effects to GoldWave (click to copy).
- https://goldwave.com/pion/echo.html
- https://goldwave.com/pion/mix.html
- https://goldwave.com/pion/scan.html
● Get Started!
Follow these steps to get started:
- Download the pion.js code, which is the core API of all audio effects.
- Create a new effect.html file or start with one of the example files and change it as needed.
- Create an EffectData structure and fill in the details for your effect. Check out the examples
for details.
- Make an onload function that sets up the PION connection and sets the callbacks
(OnConnect, OnClose, OnError, OnCommand, and OnData).
- The OnCommand callback sets, gets, or resets effect parameters.
- The OnData callback processes the audio data for the effect.
Plug-in Over Network, PION, PIONAPI and PION logo are trademarks of GoldWave Inc.