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 bxt_emit_sound #83

Merged
merged 9 commits into from
Jul 28, 2024
Merged

Add bxt_emit_sound #83

merged 9 commits into from
Jul 28, 2024

Conversation

khanghugo
Copy link
Contributor

@khanghugo khanghugo commented Aug 2, 2023

Edit: S_StartDynamicSound might be not what I want. It doesn't work per channel as I thought it would. The reason why I changed to S_StartDynamicSound is to avoid doing extra precache mechanism so any sounds can be played. I think I might need to revert two recent changes and then figure out how to do precache (or maybe not).

Edit 2: Never mind, it is good. I am just hallucinating.

Edit 3: After some more playing around, I think I have to make it similar to speak where it emits from where the player view is, rather than player origin. Big TODO in there and I thought it wouldn't come back.

Final edit: This should be good. I learn that the issue I've been having is just misusing the attenuation value. So now there are two options to emit sound with two different commands. Though for normal bxt_emit_sound, precaching might be a bit complicated for me for now to figure out how to do it properly. Meanwhile, bxt_emit_sound_dynamic can do that just fine. The difference between the two beside ability to play any sound is probably a jungle of sphagetti behind those twos. bxt_emit_sound will simply just work while bxt_emit_sound_dynamic might weirdly do something to other channels unless we pick correct channel.

@khanghugo khanghugo marked this pull request as draft August 2, 2023 22:02
@khanghugo khanghugo marked this pull request as ready for review August 2, 2023 22:18
@khanghugo khanghugo marked this pull request as draft August 6, 2023 21:19
@khanghugo khanghugo marked this pull request as ready for review August 7, 2023 17:08
@YaLTeR
Copy link
Owner

YaLTeR commented Aug 21, 2023

What's the usecase for these commands?

@khanghugo
Copy link
Contributor Author

To playback sound files very fast that it creates pitch. The way it is done now is to spam flashlight, weapon cycle, use button, speak commands. They only occupy 1-2 channels and the sounds come from the player. This PR exposes the functions and allows to play on different channel along with where the sound is emitted from. It is a less than legit way but it is harmless for any run.

@YaLTeR
Copy link
Owner

YaLTeR commented Aug 24, 2023

Doesn't that make it even less legit than putting your own audio file and playing it with speak?

@khanghugo
Copy link
Contributor Author

khanghugo commented Aug 24, 2023

This is purely performative. It can stay vaporware here. I am fine with that.

Edit: r

@YaLTeR
Copy link
Owner

YaLTeR commented Aug 24, 2023

Nah, it's fine to get it in. Was just wondering.

src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
Copy link
Owner

@YaLTeR YaLTeR left a comment

Choose a reason for hiding this comment

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

I guess this is all that's left here?

src/modules/emit_sound.rs Show resolved Hide resolved
src/modules/emit_sound.rs Outdated Show resolved Hide resolved
@khanghugo
Copy link
Contributor Author

This one is just left here for more interesting videos like this https://www.youtube.com/watch?v=2q8zCNKMoPQ

But sure.

@YaLTeR YaLTeR merged commit 525e935 into YaLTeR:master Jul 28, 2024
13 checks passed
@YaLTeR
Copy link
Owner

YaLTeR commented Jul 28, 2024

Thanks

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

Successfully merging this pull request may close these issues.

2 participants