You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SVG rectangles are largely templatable and also require configuration files to be present.
As we mount the config files into the container using Kubernetes, we provide default configurations for usage outside of Kubernetes or without a proper ConfigMap.
The config files are JSON data which nodeJS can read directly using require / import, hence we do not need to emply JSON readers.
Note that the color property is used to template the color such that the API server can replace the escape string with whatever color the user requests.
Most information for the actual rectangles can be derived from the config map.
The rendering logic for the SVG rectangles should look roughly like this:
Take an already transformed chunk from the queue of chunks. The chunks carry both the chunks value as well as the index, such that we can derive the X position
Calculate the X position using the index:x := i * config.step_width
3 Calculate the Y position of the rectangle: This depends on the mode we are in: For bottom mode, the Y position is y := (1 - chunk) * config.height, while for center mode, the Y position is y := (0.5 * config.height) - (0.5 * chunk * config.height), as we need to center the rectangle in the canvas.
Calculate the width of the rectangle: width := config.step_width - config.gap
Calculate the height of the rectangle: height := config.height * chunk
After this, append the rectangle to the SVG string already constructed.
The text was updated successfully, but these errors were encountered:
Rewrote the waveman new in Python again, this time with assumptions made about the supported mode.
Also made significant improvements in speed of the waveman by reading the file directly and only sampling small regions instead of the entire file each time. This speeds up the waveman into a mere 3 seconds for a 6 minute audio file while also reducing RAM and CPU requirements significantly.
SVG rectangles are largely templatable and also require configuration files to be present.
As we mount the config files into the container using Kubernetes, we provide default configurations for usage outside of Kubernetes or without a proper ConfigMap.
The config files are JSON data which nodeJS can read directly using require / import, hence we do not need to emply JSON readers.
A example config map looks like this:
Note that the color property is used to template the color such that the API server can replace the escape string with whatever color the user requests.
Most information for the actual rectangles can be derived from the config map.
The rendering logic for the SVG rectangles should look roughly like this:
x := i * config.step_width
3 Calculate the Y position of the rectangle: This depends on the mode we are in: For bottom mode, the Y position is
y := (1 - chunk) * config.height
, while for center mode, the Y position isy := (0.5 * config.height) - (0.5 * chunk * config.height)
, as we need to center the rectangle in the canvas.width := config.step_width - config.gap
height := config.height * chunk
After this, append the rectangle to the SVG string already constructed.
The text was updated successfully, but these errors were encountered: