Hello,
I'm doing an experiment with Livecode, and I set 4 buttons. One is to play a sound, the other is to stop the sound, and the other 2 are - and +. And I want that when I click the + button it add the same sound file upon the first one. For example, if I click 10 times it will have 10 (same) sound files playing at the same time. The minus is to reduce.
I have no clue how to do that, can anyone please help me?
Thanks!!
Increment sound file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Increment sound file
Hi Kulcanhez
If understand You correctly, i think you need a player to do that.
You can send messages to player by script and player have many features
You may take a look to "player" on dictionary
Best regards
If understand You correctly, i think you need a player to do that.
You can send messages to player by script and player have many features
You may take a look to "player" on dictionary
Best regards
https://alternatic.ch
Re: Increment sound file
Hi,
I don't know much of Livecode and this is just to make a prototype to show to a partner. I already tried a lot of things but can't manage to put the + and - working.
Attached is my .livecode if someone can give me a light I really appreciate.
Thank you very much!
I don't know much of Livecode and this is just to make a prototype to show to a partner. I already tried a lot of things but can't manage to put the + and - working.
Attached is my .livecode if someone can give me a light I really appreciate.
Thank you very much!
- Attachments
-
- app.livecode.zip
- (1.77 KiB) Downloaded 284 times
Re: Increment sound file
Hi Kulcanhez,
as Jean-Marc pointed out, you need to use PLAYER objects,
the "play" command can only play ONE file at a time.
And you did not include the WAV file in the ZIP, so we don't know
what kind of sounds you want to play.
Maybe you can post your zipped sound file here?
You will need to create 10 player objects, you can hide them,
since we only need the sound, set their filename to the WAV file.
Then you start the first player and start/stop additional players with the + and - buttons.
Problem is to "sync" the players, if neccessary, no idea in the moment how to do that...
May I ask what the purpose of your app is? May be helpful.
Best
Klaus
as Jean-Marc pointed out, you need to use PLAYER objects,
the "play" command can only play ONE file at a time.
And you did not include the WAV file in the ZIP, so we don't know
what kind of sounds you want to play.
Maybe you can post your zipped sound file here?
You will need to create 10 player objects, you can hide them,
since we only need the sound, set their filename to the WAV file.
Then you start the first player and start/stop additional players with the + and - buttons.
Problem is to "sync" the players, if neccessary, no idea in the moment how to do that...
May I ask what the purpose of your app is? May be helpful.
Best
Klaus
Re: Increment sound file
Hi Klaus,Klaus wrote:Hi Kulcanhez,
as Jean-Marc pointed out, you need to use PLAYER objects,
the "play" command can only play ONE file at a time.
And you did not include the WAV file in the ZIP, so we don't know
what kind of sounds you want to play.
Maybe you can post your zipped sound file here?
You will need to create 10 player objects, you can hide them,
since we only need the sound, set their filename to the WAV file.
Then you start the first player and start/stop additional players with the + and - buttons.
Problem is to "sync" the players, if neccessary, no idea in the moment how to do that...
May I ask what the purpose of your app is? May be helpful.
Best
Klaus
Thank you very much for your reply. I don't want to seem rude but I don't know if I am allowed to say the purpose :/
In this stage the type of sound don't change anything and don't need to be sync.
In Swift I guess I could do this pretty fast eheh but in Livecode I'm lose :p in Swift probably I would create a function to call AVFundation and then in each click it would call a function again, but AVFundation only let one play so I would need to make a little trick. But I can't use Swift because I need prototype for Windows eheh.
I'm since yesterday trying to mess around with it but no clue yet, because I really don't know much of the syntax of it. Maybe IF is not asking to much and if you are available for it and you could write that little snippet I would really appreciate.
Thank you very much once again!!
Re: Increment sound file
Hi Kulcanhez,
If you are willing and able to pay a little fee, I will gladly create a working example stack for you.
In that case please contact me privately: klaus AT major-k.de
Best
Klaus
no problem.Kulcanhez wrote:Thank you very much for your reply. I don't want to seem rude but I don't know if I am allowed to say the purpose :/
OK, that will make things a lot easier.Kulcanhez wrote:In this stage the type of sound don't change anything and don't need to be sync.
Well, I am always willing to help here in the forum, but this will require a BIT more than a little code snippet and a couple of minutes!Kulcanhez wrote:Maybe IF is not asking to much and if you are available for it and you could write that little snippet I would really appreciate.
If you are willing and able to pay a little fee, I will gladly create a working example stack for you.
In that case please contact me privately: klaus AT major-k.de
Best
Klaus