Navigation Menu

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

Fixes XACT Cue.IsPlaying Behaviour When Paused #7563

Merged
merged 2 commits into from Sep 18, 2021

Conversation

squarebananas
Copy link
Contributor

This pull request is to fix the behaviour of XACT Cue.IsPlaying when paused. More details on the issue can be found here: #7562

For demonstration purposes please see the CueIsPlaying project for both XNA and Monogame here:
https://github.com/squarebananas/MonoGameSamplesForIssues

Fixes XACT Cue.IsPlaying Behaviour When Paused
@tomspilman
Copy link
Member

@squarebananas could our unit test for XACT be fixed to verify this works correctly?

https://github.com/MonoGame/MonoGame/blob/develop/Tests/Framework/Audio/XactTest.cs

@squarebananas
Copy link
Contributor Author

@squarebananas could our unit test for XACT be fixed to verify this works correctly?

https://github.com/MonoGame/MonoGame/blob/develop/Tests/Framework/Audio/XactTest.cs

I'll look into this more, but just quickly glancing at the SoundBankPlayCue test there is the following line:
// TODO: Add actual playback tests!

That might mean there are quite a few tests to be added here.

Added Play/Pause/Resume/Stop To Existing Tests
@squarebananas
Copy link
Contributor Author

I've added play/pause/resume/stop tests within the existing SoundBankGetCue and SoundBankPlayCue tests.

The SoundBankGetCue additions ensures both XNA and MonoGame are working the same.

However with SoundBankPlayCue XNA is purely fire and forget so access to the cue is lost once started. However MonoGame provides access through AudioEngine.ActiveCues, so these additions are for MonoGame only.

Also SleepWhileAudioEngineUpdates has been added to allow the audio engine to be updated before the values are tested. This seems to only be required for XNA as some requests are not processed until an audio engine update has occurred, whereas MonoGame updates immediately.

There are a number of additional tests which could be added (such as looping / non looping operation, adpcm playback, etc.) but I'll leave those for a future PR.

@Jjagg
Copy link
Contributor

Jjagg commented Sep 18, 2021

Thanks @squarebananas! :)

@Jjagg Jjagg merged commit 41ebd55 into MonoGame:develop Sep 18, 2021
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.

None yet

3 participants