-
-
Notifications
You must be signed in to change notification settings - Fork 9
Add Sound in Console #33
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e720fe4
to
3bf4638
Compare
… sound_in_console
… sound_in_console
… sound_in_console
audio test game.zip |
There's a minor popping issue when the audio callback & rollback are slightly out of sync. I've left a comment in the audio callback about this, maybe we can get it fixed later. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First pass at trying to get the sound to play in the console. #11
I think this approach is fine for now, basically we keep a "predicted state" and tick the synths locally every time we render a game frame. It's kinda wasteful, but I'm not sure of another approach to use... Perhaps we can use channels and have the main thread "request" the sending back of audio every X samples or something, but I'm not sure how much better that will be.
Performance for this also seems pretty good, as the
audio_test
example runs at ~1% CPU or less.The basic logic for this is:
SoundEngineData
struct, which might be kinda overkill but we can see how it performs for now.Had to a bit of refactoring on how audio was being generated, as the previous method was producing too much crackling and too latency sensitive. This should be decent enough for a first pass.
TODO: