sd_mp3 going back one directory/how to set perticular file in source object #248
-
hey there, i want to play specific sound in two different conditions. like play sample1.mp3 when condition 1 true i am unable to find a way to point files in source object ,, maybe this needs to be directory only it is working fine but only one time for either of the condition because, so i want solution for
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Why don't you just use the regular stream API: on condition 1 you copy the file1 to the EncodedAudioStream() and on condition 2 you copy the other file. |
Beta Was this translation helpful? Give feedback.
-
Cool, I completely forgot that I have added that method... |
Beta Was this translation helpful? Give feedback.
Why don't you just use the regular stream API: on condition 1 you copy the file1 to the EncodedAudioStream() and on condition 2 you copy the other file.
Another way - if you want to use the AudioPlayer class - would be that you implement your own AudioSource subclass.