Hello everyone,
I was fiddling out the audio mic record demo and I saw that the recording variable gets assigned an AudioStreamSample from the AudioEffectRecord class
recording = effect.get_recording()
When the button for play is pressed, it executes these lines of code:
print(recording)
print(recording.format)
print(recording.mix_rate)
print(recording.stereo)
data = recording.get_data()
print(data.size())
$AudioStreamPlayer.stream = recording
$AudioStreamPlayer.play()
(the data variable is a member variable)
That's fine, but the issue arises when I try to assign the data variable to another audio sample, like this:
rec = AudioStreamSample.new()
rec.set_data(data)
print(rec)
print(data.size())
$AudioStreamPlayer.stream = rec
$AudioStreamPlayer.play()
The resulting audio is just noise, sometimes if I listen really hard, I can catch glimpses of what I was saying in the record. Why does this happen? And is there a solution to this?