SAPI TTS playing on windows but not in oculus
Hi guys,
I have set up an actor which on begin says a sentence just to test how this will work, I have added SAPI using VS but when I preview the app in VR, I hear the sentence come out of the laptop and not through the headphones in VR, other games etc are as expected sound only from the headset and not from the PC, any suggestions on this please, I am guessing that there must be some code to send the output to the device and not the laptop but cannot find any decent documentation anywhere about SAPI and Rift. Thanks in advance for any help, this is for an open source project.
I have set up an actor which on begin says a sentence just to test how this will work, I have added SAPI using VS but when I preview the app in VR, I hear the sentence come out of the laptop and not through the headphones in VR, other games etc are as expected sound only from the headset and not from the PC, any suggestions on this please, I am guessing that there must be some code to send the output to the device and not the laptop but cannot find any decent documentation anywhere about SAPI and Rift. Thanks in advance for any help, this is for an open source project.
// Fill out your copyright notice in the Description page of Project Settings.
#include "TOA.h"
#include "sapi.h"
#include <sphelper.h>
ATOA::ATOA()
{
PrimaryActorTick.bCanEverTick = true;
TOAMesh = CreateDefaultSubobject<UStaticMeshComponent>("TOAMesh");
PitchValue = 0.f;
YawValue = 0.f;
RollValue = 0.f;
}
void ATOA::BeginPlay(){
Super::BeginPlay();
ISpVoice * pVoice = NULL;
HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
if (SUCCEEDED(hr))
{
ISpObjectToken* cpToken(NULL);
SpFindBestToken(SPCAT_VOICES, L"gender=female", L"", &cpToken);
pVoice->SetVoice(cpToken);
cpToken->Release();
hr = pVoice->Speak(L"Hello, welcome to the Intel AI VR Retail Store", 0, NULL);
}
pVoice->Release();
pVoice = NULL;
}