Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select random music in folder #7

Merged
merged 1 commit into from
May 31, 2021
Merged

Conversation

amytimed
Copy link
Contributor

this is untested btw

this is untested btw
@charleprr charleprr self-requested a review May 31, 2021 18:23
@charleprr charleprr added the enhancement New feature or request label May 31, 2021

const transition = `${__dirname}/../resources/videos/glitch.mp4`;
const backgroundMusic = `${__dirname}/../resources/sounds/lofi1.mp3`;
const backgroundMusic = `${__dirname}/../resources/sounds/` + music[Math.floor(Math.random() * music.length)];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will pick a random music file at import time, meaning if you generate multiple videos, they will all have that same music background. But this is good enough for now, I'll merge it.

@charleprr charleprr merged commit 9d7ff07 into charleprr:master May 31, 2021
@charleprr charleprr linked an issue May 31, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select a random background music file
2 participants