Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Clone ofSoundPlayer object

$
0
0

I'm trying to load the same audio file in three different soundplayer objects, it works with the following code:

                soundPlayer1.loadSound(audioFolder + "/" + dmtr.parametrosString["AUDIOSREICH"]);
                soundPlayer2.loadSound(audioFolder + "/" + dmtr.parametrosString["AUDIOSREICH"]);
                soundPlayer3.loadSound(audioFolder + "/" + dmtr.parametrosString["AUDIOSREICH"]);

but it load three times the same big file, so I'm wondering if something along this lines is possible:

                soundPlayer1.loadSound(audioFolder + "/" + dmtr.parametrosString["AUDIOSREICH"]);
                soundPlayer2 = soundPlayer1;
                soundPlayer3 = soundPlayer1;

This code is valid but only the soundPlayer3 actually plays.
Thank you!


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>