* @return
*/
private AudioNode findAudio(Spatial spat) {
if (spat instanceof AudioNode) {
//spat is an AudioNode
AudioNode em = (AudioNode) spat;
//getting the UserData TrackInfo so check if it should be attached to this Track
TrackInfo t = (TrackInfo) em.getUserData("TrackInfo");
if (t != null && t.getTracks().contains(this)) {
return em;
}
return null;
} else if (spat instanceof Node) {
for (Spatial child : ((Node) spat).getChildren()) {
AudioNode em = findAudio(child);
if (em != null) {
return em;
}
}
}