void ReceivingAudio() {
var receivedAudioSource = GetComponent<AudioSource>();
var receiveStream = new MediaStream();
receiveStream.OnAddTrack = e => {
if(e.Track is AudioStreamTrack track)
{
receivedAudioSource.SetTrack(track);
receivedAudioSource.loop = true;
receivedAudioSource.Play();
}
}
}
void FixedUpdate() {
if(receivedAudioSource != null) {
float[] data = new float[256]
receivedAudioSource.GetSpectrumData(data, 0, FFTWindow.Rectangular)
// do something
}
}
After sending peer has connected to receiving peer data array is empty, cause receivedAudioSource.clip is null, but receiver has sound from sender
Current Behavior
I have implemented audio streaming channel on LAN with own signalling server. Everything works good.
After receiving the audio stream track on remote PC I need get a output data or spectrum data from the Audio Source. But the receiving Audio Source doesn't contains a audio clip and i get the empty float array from the necessary methods (AudioSource.GetSpectrumData() or AudioSource.GetOutPutData())
I tried the Audio Sample. The Same thing there.
Expected Behavior
Maybe there are other ways to get a data from audio clip?
Package version
3.0.0-pre.7
Environment
Steps To Reproduce
After sending peer has connected to receiving peer data array is empty, cause receivedAudioSource.clip is null, but receiver has sound from sender
Current Behavior
I have implemented audio streaming channel on LAN with own signalling server. Everything works good. After receiving the audio stream track on remote PC I need get a output data or spectrum data from the Audio Source. But the receiving Audio Source doesn't contains a audio clip and i get the empty float array from the necessary methods (AudioSource.GetSpectrumData() or AudioSource.GetOutPutData()) I tried the Audio Sample. The Same thing there.
Expected Behavior
Maybe there are other ways to get a data from audio clip?
Anything else?
No response