mobilePlaySoundOnChannel with more sounds error?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

mobilePlaySoundOnChannel with more sounds error?

William de Smet-2
Hi there,


Fore an upgrade for one of my iOS Math apps I want to add sound.
The idea is to pronounce each sum (5+3= or 8-2=).
Based upon the numbers the right sounds need to be played.

Not that difficult (I thought) but I am testing it with 3 sound files
(1,2,3) and on my iPad it only plays the first and the third one.
I am using mobilePlaySoundOnChannel:

mobilePlaySoundOnChannel tSoundFile1, "current", "now"
mobilePlaySoundOnChannel tSoundFile2, "current", "next"
mobilePlaySoundOnChannel tSoundFile3, "current", "next"

All the sound files work fine and the LiveCode Dictionary gives me no other
clue.

What am I doing wrong?

greetings,

William
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

Pierre Sahores-2
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

Le 30 oct. 2013 à 11:10, William de Smet a écrit :

> Hi there,
>
>
> Fore an upgrade for one of my iOS Math apps I want to add sound.
> The idea is to pronounce each sum (5+3= or 8-2=).
> Based upon the numbers the right sounds need to be played.
>
> Not that difficult (I thought) but I am testing it with 3 sound files
> (1,2,3) and on my iPad it only plays the first and the third one.
> I am using mobilePlaySoundOnChannel:
>
> mobilePlaySoundOnChannel tSoundFile1, "current", "now"
> mobilePlaySoundOnChannel tSoundFile2, "current", "next"
> mobilePlaySoundOnChannel tSoundFile3, "current", "next"
>
> All the sound files work fine and the LiveCode Dictionary gives me no other
> clue.
>
> What am I doing wrong?
>
> greetings,
>
> William
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> 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


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

William de Smet-2
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 <[hidden email]>

> 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
>
> Le 30 oct. 2013 à 11:10, William de Smet a écrit :
>
> > Hi there,
> >
> >
> > Fore an upgrade for one of my iOS Math apps I want to add sound.
> > The idea is to pronounce each sum (5+3= or 8-2=).
> > Based upon the numbers the right sounds need to be played.
> >
> > Not that difficult (I thought) but I am testing it with 3 sound files
> > (1,2,3) and on my iPad it only plays the first and the third one.
> > I am using mobilePlaySoundOnChannel:
> >
> > mobilePlaySoundOnChannel tSoundFile1, "current", "now"
> > mobilePlaySoundOnChannel tSoundFile2, "current", "next"
> > mobilePlaySoundOnChannel tSoundFile3, "current", "next"
> >
> > All the sound files work fine and the LiveCode Dictionary gives me no
> other
> > clue.
> >
> > What am I doing wrong?
> >
> > greetings,
> >
> > William
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > 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
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

Pierre Sahores-2
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 <[hidden email]>
>
>> 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
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

William de Smet-2
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 <[hidden email]>

> 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 <[hidden email]>
> >
> >> 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
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

Dave Kilroy
Hi William

soundFinishedOnChannel works for me on 6.1.2 (iOS, not used it on Android yet)

Dave
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

Pierre Sahores-2
In reply to this post by William de Smet-2
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 <[hidden email]>
>
>> 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 <[hidden email]>
>>>
>>>> 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
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> 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


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

William de Smet-2
In reply to this post by Dave Kilroy
Hi Dave,

Good to hear it works for you.
So it is not LC 6.1.2.
It must be me then :-).

@Pierre: that's very kind of you.


greetings,

William


2013/11/1 Dave Kilroy <[hidden email]>

> Hi William
>
> soundFinishedOnChannel works for me on 6.1.2 (iOS, not used it on Android
> yet)
>
> Dave
>
>
>
> -----
> "Some are born coders, some achieve coding, and some have coding thrust
> upon them." - William Shakespeare & Hugh Senior
>
> --
> View this message in context:
> http://runtime-revolution.278305.n4.nabble.com/mobilePlaySoundOnChannel-with-more-sounds-error-tp4671645p4671733.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

Dave Kilroy
William

I should have done it like Pierre ... it works for me under LC 6.1.2 on OSX(Mavericks) with Xcode 5.01 and I tested it on iOS6 & 7
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: mobilePlaySoundOnChannel with more sounds error?

Pierre Sahores-2
In reply to this post by William de Smet-2
Hi again William,

See the mobilesoundplayer sample stack iOS & Android compatible i just uploaded to RevOnline with Android, iOS, mobile, sound as tags. Works fine against real Android 2 to 4 and iOS 5 to 7 tablets and mobiles devices (simulators untested).

Best,

Pierre

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

> Hi Dave,
>
> Good to hear it works for you.
> So it is not LC 6.1.2.
> It must be me then :-).
>
> @Pierre: that's very kind of you.
>
>
> greetings,
>
> William
>
>
> 2013/11/1 Dave Kilroy <[hidden email]>
>
>> Hi William
>>
>> soundFinishedOnChannel works for me on 6.1.2 (iOS, not used it on Android
>> yet)
>>
>> Dave
>>
>>
>>
>> -----
>> "Some are born coders, some achieve coding, and some have coding thrust
>> upon them." - William Shakespeare & Hugh Senior
>>
>> --
>> View this message in context:
>> http://runtime-revolution.278305.n4.nabble.com/mobilePlaySoundOnChannel-with-more-sounds-error-tp4671645p4671733.html
>> Sent from the Revolution - User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> 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


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode