speechPlayer: fix sample type qualification to avoid ambiguity
As reported in <https://bugs.freebsd.org/271486>, when the C++ standard
library provides std::sample, it causes a compile error when compiling
speechWaveGenerator.cpp:
src/speechPlayer/src/speechWaveGenerator.cpp:197:56: error: reference to 'sample' is ambiguous
unsigned int generate(const unsigned int sampleCount, sample* sampleBuf) {
^
src/speechPlayer/src/sample.h:23:3: note: candidate found by name lookup is 'sample'
} sample;
^
/usr/include/c++/v1/__algorithm/sample.h:95:17: note: candidate found by name lookup is 'std::sample'
_SampleIterator sample(_PopulationIterator __first,
^
Since speechWaveGenerator.cpp puts "using namespace std;" at the top,
fix the error by qualifying "sample" with an explicit "::".
Similarly to dab5457620 "Fix deleting FrameManagerImpl*", we need a
virtual destructor. clang was complaining about it:
src/speechPlayer/src/speechPlayer.cpp:52:2: warning: delete called on 'SpeechWaveGenerator' that is abstract but has non-virtual destructor [-Wdelete-abstract-non-virtual-dtor]
delete playerHandleInfo->waveGenerator;
^
delete playerHandleInfo->frameManager wasn't actually calling
FrameManagerImpl~, because playerHandleInfo->frameManager is only a
FrameManager, which didn't have a destructor, and nothing was saying that
it's actually a FrameManagerImpl behind. Adding a virtual destructor
fixes that.