I am trying to get AudioNode to handle sequential play of audio files so characters can speak via concatenated speech files.
However, there seems to be a limitation I do not understand.
I see that setAudioData hints that what I am trying to do is somehow verboten — taking an existing AudioNode and handing it a new audio file I’d like it to play after the first has completed.
public void setAudioData(AudioData audioData, AudioKey audioKey) {
if (data != null) {
throw new IllegalStateException("Cannot change data once its set");
}
data = audioData;
this.audioKey = audioKey;
}
What is the prescribed method for such a trick?
I already have spent some time adding a callback so that an AudioNode can alert a listener object when its playback has just completed, but it appears as if I have to toss each audio node after each individual file’s play, which seems inefficient.
tone