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

CDN audio streaming through HTTP #5550

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

luizwritescode
Copy link

About the PR

Disclaimer: At current state this is more of a proof-of-concept than anything. However, I need feedback to make this work so I'm submitting this as a draft.

What is this

A attempt to tackle the problem with bloating game files by giving the engine a way to download audio files from a http source and use them as needed.

Originally this was an attempt to port the efforts of this 12 year old blog post to stream OGG audio files in chunks and play those chunks as the file still downloads. This could be done by tweaking NVorbis, but I still could not get it to work.

Instead, GetFileAsync saves the entire file to disk. To check if file is downloaded and playable, I introduced a little hack in method PlayOggAudioFile for testing purposes, but all playback logic will have to be moved somewhere else.

The main idea here is the introduction of CDNConsumer class to provide engine with audio files on-the-fly, but it needs polishing

TODO:

  • Move all hardcoded variables to configuration files
  • Implement downloading and playing files in chunks for large files (is this even possible?)
  • Use a system to manage resources instead of just checking if file exists in disk
  • Add a method to remove and dispose sources from _activeSources after they are done playing
  • Remove audio playback logic (only there for testing)

Media

playaudiocdn.mp4

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.

1 participant