Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Expose FAudioContext or Device Handle #455

Open
tomcashman opened this issue Nov 24, 2023 · 3 comments
Open

Expose FAudioContext or Device Handle #455

tomcashman opened this issue Nov 24, 2023 · 3 comments

Comments

@tomcashman
Copy link
Contributor

We're currently accessing the FAudioContext device pointer to set up some in-memory caching/streaming of music files on Nintendo Switch. To do this, we patch in the following function to SoundEffect.cs to get the device pointer.

		public static IntPtr DeviceHandle()
		{
			return Device().Handle;
		}

Ideally we could access this via an EXT method.

Would this be accepted as PR? If so, where/how do you recommend exposing it?

Or, if there's a better way to do the in-memory caching/streaming I'm open to suggestions.

@flibitijibibo
Copy link
Member

We could possibly do SoundEffect.FromPointerEXT instead; the application can load all PCM data to a single host pointer and then call SoundEffect.FromPointerEXT with the offset pointer and the wave format, and all SoundEffect has to do on disposal is avoid freeing the host pointer.

@tomcashman
Copy link
Contributor Author

I assume that approach wouldn't create the voice using FAUDIO_VOICE_MUSIC? Would there be any potential issues to that?

@flibitijibibo
Copy link
Member

It likely would not, no... I actually haven't come across a use case for that flag yet (at least within XNA) so more details would help a lot here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants