audio glossary proof of concept

This commit is contained in:
Ryan 2024-03-15 20:43:21 -04:00
commit 4a0a2c9e88
2 changed files with 22 additions and 2 deletions

View file

@ -18,6 +18,10 @@
#include "soh/Enhancements/tts/tts.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/audio/AudioDecoder.h"
std::vector<uint32_t> buttons = { BTN_A, BTN_B, BTN_CUP, BTN_CDOWN, BTN_CLEFT, BTN_CRIGHT, BTN_L,
BTN_Z, BTN_R, BTN_START, BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT };
extern "C" {
extern PlayState* gPlayState;
extern bool freezeGame;
@ -465,11 +469,25 @@ int ActorAccessibility_GetRandomStartingFrameCount(int min, int max) {
list = (VAList_t*)aa->currentSceneGlobal;
for (VAList_t::iterator i = list->begin(); i != list->end(); i++)
ActorAccessibility_RunAccessibilityForActor(play, &(*i));
ActorAccessibility_AudioGlossary(play);
//Processes external audio engine.
ActorAccessibility_PrepareNextAudioFrame();
}
//Virtual actor config.
void ActorAccessibility_AudioGlossary(PlayState* play) {
AccessibleActorList_t::iterator i = aa->accessibleActorList.begin();
OSContPad* trackerButtonsPressed = LUS::Context::GetInstance()->GetControlDeck()->GetPads();
bool comboStartGlossary = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & buttons[10] &&
trackerButtonsPressed[0].button & buttons[6];
if (comboStartGlossary) {
SpeechSynthesizer::Instance->Speak((*i).second.policy.englishName, GetLanguageCode());
return;
}
}
//Virtual actor config.
VirtualActorList* ActorAccessibility_GetVirtualActorList(s16 sceneNum, s8 roomNum)
{
SceneAndRoom sr;

View file

@ -184,6 +184,8 @@ void ActorAccessibility_HandleSoundExtractionMode(PlayState* play);
//This is called by the audio thread when it's ready to try to pull sfx from the game.
void ActorAccessibility_DoSoundExtractionStep();
void ActorAccessibility_AudioGlossary(PlayState* play);
#ifdef __cplusplus
}