Increment sound file

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
Kulcanhez
Posts: 6
Joined: Sat Oct 08, 2016 6:42 pm

Increment sound file

Post by Kulcanhez » Wed Aug 02, 2017 7:49 pm

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!!

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2199
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Increment sound file

Post by jmburnod » Wed Aug 02, 2017 9:56 pm

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

Kulcanhez
Posts: 6
Joined: Sat Oct 08, 2016 6:42 pm

Re: Increment sound file

Post by Kulcanhez » Thu Aug 03, 2017 11:26 am

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!
Attachments
app.livecode.zip
(1.77 KiB) Downloaded 52 times

Klaus
Posts: 10126
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Increment sound file

Post by Klaus » Thu Aug 03, 2017 12:01 pm

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

Kulcanhez
Posts: 6
Joined: Sat Oct 08, 2016 6:42 pm

Re: Increment sound file

Post by Kulcanhez » Thu Aug 03, 2017 12:38 pm

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
Hi 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!!

Klaus
Posts: 10126
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Increment sound file

Post by Klaus » Thu Aug 03, 2017 1:06 pm

Hi Kulcanhez,
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 :/
no problem.
Kulcanhez wrote:In this stage the type of sound don't change anything :) and don't need to be sync.
OK, that will make things a lot easier.
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.
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! 8)

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

Post Reply

Return to “Rich Media”