Fill out xaudio2_object_flush and fix MinGW64 build - #34
Open
mcarans wants to merge 2 commits into
Open
Conversation
libtool fix for mingw64
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
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.
This PR makes a few changes in configure.am and Makefile.am to allow the build to complete successfully on MinGW64.
It populates the xaudio2_object_flush function to enable cancelling of a playing sound.
A test program is here: https://github.com/mcarans/AudioTest/blob/main/testpcaudiolib.cpp. It loads a long wav and then using pcaudiolib, plays it then cancels it after 2 seconds. It works fine on Windows MinGW64.
For this cancellation to work in espeak-ng, this PR that performs the audio_object_flush step before fifo_stop is required otherwise the playing speech is not cancelled at all: espeak-ng/espeak-ng#2288
This library along with espeak-ng have been tested within the Oolite game on Windows MinGW64 and the ability to cancel playing speech works well in the game (and is essential for smooth play).
The updated pcaudiolib was also tested on Ubuntu to ensure nothing has been broken.