Have a simple program running on Raspberry PI. When hooked up to monitor with speakers I can get the voice speaking through the HDMI speakers. However, I want the voice to output through bluetooth speakers. The connected bluetooth speakers play when I play some audio files, but when I run FreeTTS program the sound outputs either through HDMI audio or when headless and connected only to bluetooth speakers, there is no output at all. I'm thinking maybe it's trying to play through some default audio, since it plays through HDMI speakers even with bluetooth selected in audio menu... Here's the basic code I started with.
Voice voice;
VoiceManager voiceManager = VoiceManager.getInstance();
voice = voiceManager.getVoice(voiceName);
voice.allocate();
voice.speak(text);
I've been trying additions, but nothing has worked so far. I was thinking I maybe needed to connect an AudioPlayer of some sort, but I couldn't get the default streaming one working. I need the audio played immediately. Any thoughts?