asmr-video-generator
v1772075.732.183
Published
Professional integration for https://supermaker.ai/video/asmr-video-generator/
Maintainers
Readme
asmr-video-generator
A JavaScript library for programmatically generating ASMR videos with customized audio and visual elements. Create soothing and engaging content with ease.
Installation
Install the package using npm: bash npm install asmr-video-generator
Usage Examples
Here are several examples demonstrating how to use asmr-video-generator in your JavaScript or Node.js projects:
Example 1: Basic ASMR Video Generation
This example demonstrates the simplest way to generate an ASMR video with default settings. javascript const { generateASMRVideo } = require('asmr-video-generator');
async function createBasicVideo() {
try {
const videoPath = await generateASMRVideo({
duration: 10, // seconds
});
console.log(ASMR video generated successfully at: ${videoPath});
} catch (error) {
console.error("Error generating video:", error);
}
}
createBasicVideo();
Example 2: Customizing Audio and Visuals
This example shows how to customize the audio track and visual elements of the generated video. javascript const { generateASMRVideo } = require('asmr-video-generator');
async function createCustomVideo() {
try {
const videoPath = await generateASMRVideo({
duration: 15, // seconds
audio: {
filePath: 'path/to/your/audio.mp3', // Replace with your audio file
volume: 0.7, // Adjust volume (0.0 - 1.0)
},
visuals: {
backgroundColor: '#E6E6FA', // Lavender background
overlayImage: 'path/to/your/image.png', // Replace with your image file
overlayOpacity: 0.5,
},
});
console.log(Custom ASMR video generated at: ${videoPath});
} catch (error) {
console.error("Error generating video:", error);
}
}
createCustomVideo();
Example 3: Implementing a Progress Callback
Track the progress of video generation using a callback function. javascript const { generateASMRVideo } = require('asmr-video-generator');
async function createVideoWithProgress() {
try {
const videoPath = await generateASMRVideo({
duration: 20,
progressCallback: (progress) => {
console.log(Video generation progress: ${progress}%);
},
});
console.log(ASMR video generated successfully at: ${videoPath});
} catch (error) {
console.error("Error generating video:", error);
}
}
createVideoWithProgress();
Example 4: Using a Different Output Format
Specify the desired output format for the generated video. javascript const { generateASMRVideo } = require('asmr-video-generator');
async function createVideoWithFormat() {
try {
const videoPath = await generateASMRVideo({
duration: 10,
outputFormat: 'avi', // or 'mov', etc.
});
console.log(ASMR video generated successfully at: ${videoPath});
} catch (error) {
console.error("Error generating video:", error);
}
}
createVideoWithFormat();
API Summary
generateASMRVideo(options): Generates an ASMR video based on the provided options.options(Object): An object containing configuration parameters.duration(Number, required): The duration of the video in seconds.audio(Object, optional): Configuration for the audio track.filePath(String, optional): Path to the audio file. If not provided, a default ASMR audio will be used.volume(Number, optional): Volume level (0.0 - 1.0). Defaults to 1.0.
visuals(Object, optional): Configuration for the visual elements.backgroundColor(String, optional): Background color in hexadecimal format (e.g., '#FFFFFF'). Defaults to black.overlayImage(String, optional): Path to an image to overlay on the video.overlayOpacity(Number, optional): Opacity of the overlay image (0.0 - 1.0). Defaults to 1.0.
outputFormat(String, optional): The output video format (e.g., 'mp4', 'avi', 'mov'). Defaults to 'mp4'.progressCallback(Function, optional): A callback function that receives the generation progress as a percentage (0-100).
- Returns: A Promise that resolves with the file path of the generated video.
License
MIT
This package is part of the asmr-video-generator ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/video/asmr-video-generator/
