Modified the "check" script in package.json to reference the correct "examples" directory. Updated the README to replace "video editor" with "media compositor" for improved accuracy and restructured some sentences for better readability. Removed outdated documentation files related to assets, CLI, composition, distribution, and getting started, streamlining the documentation for a more focused user experience.
1.9 KiB
dapi media waveform <id|path>
Renders the audio track of a video or audio file as an amplitude waveform PNG, written to a file in the system temp directory: loudness over time drawn from decoded audio peaks, with a timestamp ruler. Silent stretches are highlighted in red. Renders locally; no credits. Alias: wave.
Tick labels use HH:MM:SS:FF timecode (hours, minutes, seconds, frame within the second) at every zoom level, so labels stay comparable regardless of the window's span. For a video, frames count against the video's frame rate; for a standalone audio asset, the ruler counts against a nominal 30 fps.
Input
<id|path>: a video or audio asset id, or a local file to preview in place without adding it to the library (required).-s, --start <time>: start of the window to preview, aTimevalue in source/content time (optional; default0).-e, --end <time>: end of the window to preview, aTimevalue (optional; default the asset's duration).-x, --scale <factor>: scale factor for the waveform (optional; default1, clamped to0.25-4). The overall canvas size stays fixed, so a smaller scale fits more rows and columns (a denser time axis) and a larger scale fits fewer but taller rows.-o, --output <path>: write the PNG here instead of a temp file (optional).
Output
One JSON object, the absolute path to the written PNG plus the silent stretches (the red spans on the waveform) as [start, end] second ranges, in absolute seconds (offset by --start when a window is used):
{
path: string, // e.g. "/tmp/3f2c1a8e-....png", or the --output path
silences: Array<{ start: number, end: number }>,
}
Errors
Exits non-zero if the id is unknown, the asset has no decodable audio track, --start/--end fall outside the asset or cross (--start >= --end), --scale isn't a positive number, or --output can't be written.