Godot Version
5.3 or 5.4
Question
Is there a way in GoDot to play an audio stream?
We found a way to play an audio file, but what we are trying to do is to play an NDI stream with sound. While we can play the NDI video stream without problem, but we have problem finding a way to play the NDI audio stream.
Any help would be greatly appreciated. Thanks in advance.
you need to put the data into a stream object and play the audio.
Although this is not complete, and has some bugs this is on the lines of what you want to do.
var stream = AudioStreamMP3.new()
var start = false
func _process(_delta):
if http.has_response():
start = true
if start:
var data : PackedByteArray = http.read_response_body_chunk()
if data.size() > 0:
print(name,": reading data")
#print(data)
stream.data = data
stream.loop = true
$AudioStreamPlayer.stream = stream
$AudioStreamPlayer.play()
I did some more digging, AudioStreamgGenerator is what you want, but it most likely won’t work if the NDI stream is compressed
Thanks a lot for your advices
We will give AudioStreamGenerator a try.
Thank you