charmbracelet / charmbracelet/vhs

Add support for playing audio in video outputs

Open
#65 3 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
20.9k
Forks
474
Avg merge
4d 1h
Merged PRs (30d)
2

Description

This request might be out of scope for the project overall, and if that's the case please ignore it.

I was wondering if its possible to add a feature where one would be able to start playing a specific audio file after a specific point in the script (for example after displaying a specific command). This might be helpful in cases where one would like to make some educational material or even for documentation purposes, or onboardings.

Constructs to play the audio and to concurrently play or await for the audio once played might be useful to serve the above purposes. "ID" constructs might be added to also micro control the awaiting, to specify for which audio should the player wait if multiple ones where playing at the same time.

Adding such feature might be used as follows if one was to edit them into the sample in the readme:

```

# Where should we write the GIF?
Output demo.mp4

...

# Pause for dramatic effect...
Sleep 500ms

## plays the specified audio file
PlayAudio two-Inception-style-BRAAMS-followed-in-succession.wav

## awaits for the played audio to finish before continuing with the demo
AwaitAudio

# Run the command by pressing enter.
Enter

...
```

Is this feature making the project into a declarative sort of term video editing tool? Yeah kinda, but I was thinking maybe its simple enough that it could serve a specific niche, as using full blown video editors for simple tool demos or documentation purposes can be really frustrating and an overkill.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the README sample and the existing command syntax around Output and Sleep. Clarify whether audio playback is in scope, then determine how the proposed PlayAudio and AwaitAudio commands should behave when audio overlaps. Done means an agreed design and working support for the requested playback and waiting semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
audio-video-rtc, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.