play two sounds
Pierre Sahores
sc at sahores-conseil.com
Tue Apr 29 02:24:42 EDT 2014
Hi Larry,
in the preopenstack command :
> put specialFolderPath("engine") & "/CityChic.mp3" into Melodie[1] ### spécifique sous-domaine : 1_a/7 ###
> put specialFolderPath("engine") & "/CitySport.mp3" into Melodie[2] ### spécifique sous-domaine : 1_b/7 ###
> put specialFolderPath("engine") & "/Elegance.mp3" into Melodie[3] ### spécifique sous-domaine : 1_c/7 ###
> put specialFolderPath("engine") & "/Graphique.mp3" into Melodie[4] ### spécifique sous-domaine : 1_d/7 ###
In the stack handler :
> on soundlevelonoff
> if "firstChannel" is not in mobileSoundChannels() then
> mobilePlaySoundOnChannel Melodie[random("4")], "firstChannel", "now"
> if "soundswitcher" is in the target
> then set the icon of the target to 7908
> mobileSetSoundChannelVolume "firstChannel", 100
> else if mobileSoundChannelStatus("firstChannel") is "paused" then
> if "soundswitcher" is in the target
> then set the icon of the target to 7908
> mobileResumePlayingOnChannel "firstChannel"
> else if "soundswitcher" is in the target then
> mobilePausePlayingOnChannel "firstChannel"
> set the icon of the target to 7909
> else mobilePausePlayingOnChannel "firstChannel"
> end soundlevelonoff
>
>
> on soundFinishedOnChannel tchannel, thesound
> if thesound is Melodie[1]
> then mobilePlaySoundOnChannel Melodie[2], tchannel, "now"
> else if thesound is Melodie[2]
> then mobilePlaySoundOnChannel Melodie[3], tchannel, "now"
> else if thesound is Melodie[3]
> then mobilePlaySoundOnChannel Melodie[4], tchannel, "now"
> else mobilePlaySoundOnChannel Melodie[1], tchannel, "now"
> end soundFinishedOnChannel
In a button handler :
> on mouseup
> soundlevelonoff
> end mouseup
Works fine under iOS and Android. To be tested and adapted under other platforms.
Best,
Pierre
Le 29 avr. 2014 à 07:33, <larry at significantplanet.org> <larry at significantplanet.org> a écrit :
> I have two .wav files imported into my stack.
>
> When the stack opens, I want to play audio1 and when it finishes, then play audio2
>
> Does anyone know the syntax for doing this?
>
> TIA
> Larry
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
--
Pierre Sahores
mobile : 06 03 95 77 70
www.sahores-conseil.com
More information about the use-livecode
mailing list