mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:57:58 +02:00
CR feedback - thanks Ken!
This commit is contained in:
parent
48d3450c5a
commit
cee1454f6e
1 changed files with 3 additions and 7 deletions
|
@ -75,7 +75,7 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
WAVEFORMATEX fmt;
|
WAVEFORMATEX fmt;
|
||||||
fmt.wFormatTag = WAVE_FORMAT_PCM;
|
fmt.wFormatTag = WAVE_FORMAT_PCM;
|
||||||
fmt.nSamplesPerSec = 24000;
|
fmt.nSamplesPerSec = AudioConstants::SAMPLE_RATE;
|
||||||
fmt.wBitsPerSample = 16;
|
fmt.wBitsPerSample = 16;
|
||||||
fmt.nChannels = 1;
|
fmt.nChannels = 1;
|
||||||
fmt.nBlockAlign = fmt.nChannels * fmt.wBitsPerSample / 8;
|
fmt.nBlockAlign = fmt.nChannels * fmt.wBitsPerSample / 8;
|
||||||
|
@ -132,17 +132,13 @@ void TTSScriptingInterface::speakText(const QString& textToSpeak) {
|
||||||
hr = IStream_Size(pStream, &StreamSize);
|
hr = IStream_Size(pStream, &StreamSize);
|
||||||
|
|
||||||
DWORD dwSize = StreamSize.QuadPart;
|
DWORD dwSize = StreamSize.QuadPart;
|
||||||
char* buf1 = new char[dwSize + 1];
|
_lastSoundByteArray.resize(dwSize);
|
||||||
memset(buf1, 0, dwSize + 1);
|
|
||||||
|
|
||||||
hr = IStream_Read(pStream, buf1, dwSize);
|
hr = IStream_Read(pStream, _lastSoundByteArray.data(), dwSize);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
qDebug() << "Couldn't read from stream.";
|
qDebug() << "Couldn't read from stream.";
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastSoundByteArray.resize(0);
|
|
||||||
_lastSoundByteArray.append(buf1, dwSize);
|
|
||||||
|
|
||||||
AudioInjectorOptions options;
|
AudioInjectorOptions options;
|
||||||
options.position = DependencyManager::get<AvatarManager>()->getMyAvatarPosition();
|
options.position = DependencyManager::get<AvatarManager>()->getMyAvatarPosition();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue