Skip to content

Commit f264b2b

Browse files
committed
make speech positional
1 parent 1b61cf9 commit f264b2b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎grngame/audio/speech.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,25 @@
22

33
#include "grngame/core/app.h"
44

5+
#include <math.h>
6+
57
void SpeechSay(const char *text, const SoundInfo *sound_info)
68
{
9+
// TODO have it work with filters like sound
10+
711
Speech *speech = g_app.sound_manager.speech;
812
Soloud soloud = g_app.sound_manager.soloud;
913

1014
Speech_setText(speech, text);
1115
Speech_setVolume(speech, sound_info->volume);
1216
Speech_setLooping(speech, sound_info->looping);
1317

14-
Soloud_play(soloud, speech);
18+
if (!isnan(sound_info->position.x) && !isnan(sound_info->position.y))
19+
{
20+
Soloud_play3d(soloud, speech, sound_info->position.x, sound_info->position.y, 0.0f);
21+
}
22+
else
23+
{
24+
Soloud_play(soloud, speech);
25+
}
1526
}

0 commit comments

Comments
 (0)