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

Add OOP wrapper for playing speeches #35

Open
meszaros-lajos-gyorgy opened this issue Oct 25, 2024 · 0 comments
Open

Add OOP wrapper for playing speeches #35

meszaros-lajos-gyorgy opened this issue Oct 25, 2024 · 0 comments

Comments

@meszaros-lajos-gyorgy
Copy link
Collaborator

There's no way to have this coded similarly to how the Speak script class creates a wrapper around the play command.

speak [goblin_ouch]

It would be nice, if the Speak class could handle this as well and the goblin_ouch sound would be wrapped by the Audio class. Something like this:

const sound = new Audio({
  filename: "[goblin_ouch]",
  type: "speech" // currently only exact matches to speech subfolders exist, like "speech/english"
})

const soundScript = new Sound(sound, SoundFlags.VaryPitch) // note that the whole audio instance is passed, not just the filename

// ...

soundScript.play() // generates "speak [goblin_ouch]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant