mobilePlaySoundOnChannel with more sounds error?

Pierre Sahores sc at sahores-conseil.com
Fri Nov 1 11:53:56 CET 2013


Hi William,

Works fine there against LC 6.1.2./Xcode 4.6.1. Will extract and send you and to RevOnline an example stack tonight.

Best,

Pierre

Le 1 nov. 2013 à 11:34, William de Smet a écrit :

> Hi Pierre,
> 
> Strangely enough it doesn't work for me.
> It did put 'soundlevelonoff' in a button but no sound is played.
> And yes I changed your code to use my own soundfiles.
> 
> Could it be LC 6.1.2?
> 
> greetings,
> 
> William
> 
> 
> 2013/11/1 Pierre Sahores <sc at sahores-conseil.com>
> 
>> Hi William,
>> 
>> See the message "soundFinishedOnChannel" in the dictionary and its
>> associated example snippet) . It's automatically send by LC each time a
>> sound finish to play on any opened channel and, can in this way handle what
>> i want it to do on the "firstChannel" channel witch is inited in calling
>> the "soundlevelonoff" command. More clear ?
>> 
>> To start and stop playing the referenced sounds, a simple push button is
>> usable :
>> 
>>> on mouseup
>>>   soundlevelonoff
>>>   mobileClearTouches
>>> end mouse up
>> 
>> Best,
>> 
>> Pierre
>> 
>> 
>> Le 31 oct. 2013 à 18:05, William de Smet a écrit :
>> 
>>> Hi Pierre,
>>> 
>>> Thanks for your reply.
>>> I can't get it to work yet.
>>> You use "firstChannel" as your channel.
>>> How is this connected with 'on soundFinishedOnChannel tchannel, the
>> sound'
>>> Is there code missing?
>>> 
>>> I am on LC 6.1.2.
>>> 
>>> 
>>> greetings,
>>> 
>>> William
>>> 
>>> 
>>> 2013/10/30 Pierre Sahores <sc at sahores-conseil.com>
>>> 
>>>> Hi William,
>>>> 
>>>> See below as an example working case (iOS/Android) :
>>>> 
>>>>> on preopenstack
>>>>>  put specialFolderPath("engine") & "/CityChic.mp3" into Melodie[3]
>>>>>  put specialFolderPath("engine") & "/CitySport.mp3" into Melodie[4]
>>>>>  put specialFolderPath("engine") & "/Elegance.mp3" into Melodie[1]
>>>>>  put specialFolderPath("engine") & "/Graphique.mp3" into Melodie[2]
>>>>> end preopenstack
>>>> 
>>>> 
>>>>> 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
>>>> 
>>>> Best Regards,
>>>> 
>>>> Pierre
>> 
>> --
>> Pierre Sahores
>> mobile : 06 03 95 77 70
>> www.sahores-conseil.com
>> 
>> 
>> _______________________________________________
>> 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
>> 
> _______________________________________________
> 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