bob_q3tts.tts_node

Classes

TTSnode

ROS node that provides an interface to Qwen3-TTS with streaming text aggregation.

Functions

main([args])

Start the TTS node.

Module Contents

class bob_q3tts.tts_node.TTSnode

Bases: rclpy.node.Node

ROS node that provides an interface to Qwen3-TTS with streaming text aggregation.

text_buffer = ''
last_text_time
text_queue
audio_queue
lock
file_index
inferred_target_sr = None
_is_speaking = False
_speaking_finish_time = 0.0
sub
pub
audio_pub
speaking_pub
model = None
sd = None
sf = None
torch = None
tts_thread
audio_thread
flush_timer
speaking_monitor_timer
_get_sf()

Lazy load soundfile library.

text_callback(msg)

Aggregate incoming words/text into sentences based on delimiters.

flush_timer_callback()

Flush the text buffer if the timeout has passed.

_apply_substitutions(text)

Apply regex-based substitutions to the text.

tts_loop()

Process the text queue and generate audio.

audio_loop()

Consume the audio queue for playback and storage.

play_audio(audio_data, sr)

Play audio using native library or configured executable.

_do_native_play(audio_data, sr)

Perform native audio playback using sounddevice.

resample_audio(audio_data, orig_sr, target_sr)

Resample audio data using librosa if available, else linear interpolation.

_play_with_executable(executable, audio_data, sr)

Play audio using an external command.

speaking_monitor_callback()

Monitor the speaking duration and reset flag after delay.

bob_q3tts.tts_node.main(args=None)

Start the TTS node.