embedded audio clips pause

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
markhinnebusch
Posts: 25
Joined: Thu May 17, 2018 7:32 pm
Location: Florida, USA

embedded audio clips pause

Post by markhinnebusch » Mon Sep 10, 2018 10:13 pm

I know that pause does not work with embedded audio clips but for intellectual property protection, I need to use embedded clips. I remember seeing somewhere on here about someone who had developed a third party that provided extended features for embedded audio clips but for the life of me, I cannot find that reference anymore.

Can anyone point me in the right direction?

On a side note... Does anyone know if you can start a clip in a player and then delete the file while it is playing? That is, do the players buffer or not? if they do, then I guess i could encrypt the audio clip, decrypt it, start the player and then delete the decrypted file. The property owner has already nixed the idea of having the decrypted clip on disk for the duration of the play. Sigh... If no one knows off hand, I'll try it and see what happens.

thanks,
mark

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4567
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: embedded audio clips pause

Post by jacque » Tue Sep 11, 2018 6:09 pm

I don't know if a buffered audio file is completely placed in memory at once, or whether it buffers as it plays. I'd suspect the latter but you'd need to test it.

What I've done in the past is store the audio as a custom property and write it to disk on demand. I used the tempfile function to create a file name, which writes it to the reasonably inaccessible temp folder with a file name consisting of random characters. When the playback is complete the file is immediately deleted.

This doesn't meet your requirements exactly but is relatively safe. Most users don't know where the temp folder is (it's deeply hidden on Mac at least) or even that such a folder exists, and the file name is gibberish and often only one of a list of other nonsensical files.

I wouldn't call this secure, but it does require the user to know that the file was written to disk, where the file is, and how to find and retrieve it.

The other option is to stream the audio from a server. That way there is no file at all. Of course, no method will prevent the user from recording the audio as it plays, so I decided that briefly storing the file in a obscure location was as good as anything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jiml
Posts: 163
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: embedded audio clips pause

Post by jiml » Tue Sep 11, 2018 9:02 pm

Does anyone know if you can start a clip in a player and then delete the file while it is playing?
I just set the filename of a player to point to a 3GB 1 hour HD movie.
alwaysBuffer was set to TRUE.
I then deleted the file.
Started the player.
It played.
Dragged the controller near to the end.
It still played fine.

So, the answer appears to be YES.

Jim Lambert

markhinnebusch
Posts: 25
Joined: Thu May 17, 2018 7:32 pm
Location: Florida, USA

Re: embedded audio clips pause

Post by markhinnebusch » Tue Sep 11, 2018 9:08 pm

Thanks for the quick replies. It looks like I may be able to do a combination of both. That is, write the file in an obscure location with an obscure name and start the player and then delete the file. That would meet my needs.

Again, thanks for the quick replies.

-mark

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4567
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: embedded audio clips pause

Post by jacque » Wed Sep 12, 2018 12:07 am

jiml wrote:
Tue Sep 11, 2018 9:02 pm
I just set the filename of a player to point to a 3GB 1 hour HD movie.
alwaysBuffer was set to TRUE.
I then deleted the file.
Started the player.
It played.
Dragged the controller near to the end.
It still played fine.

So, the answer appears to be YES.
Ohhh... Cool.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

capellan
Posts: 492
Joined: Wed Aug 15, 2007 11:09 pm
Contact:

Re: embedded audio clips pause

Post by capellan » Thu Sep 13, 2018 4:17 am

Hi All,

After reading this statement:
I just set the filename of a player to point to a 3GB 1 hour HD movie.
alwaysBuffer was set to TRUE.
I then deleted the file.
Started the player.
It played.
Dragged the controller near to the end.
It still played fine.
this famous meme, jumped from nowhere:
https://knowyourmeme.com/memes/impossibru

There should be another hidden copy of this 3Gb movie
somewhere in your Hard Disk or...
Did LiveCode memory requirements suddenly jumped
3 Gb more than before?

Al

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4567
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: embedded audio clips pause

Post by jacque » Thu Sep 13, 2018 3:33 pm

Good point. Isn't there a terminal command to see what's been written to disk recently?

Edit: On Mac, here's how: https://www.macworld.com/article/105808 ... ecent.html I'm not sure about Windows but it probably has something similar.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

markhinnebusch
Posts: 25
Joined: Thu May 17, 2018 7:32 pm
Location: Florida, USA

Re: embedded audio clips pause

Post by markhinnebusch » Thu Sep 13, 2018 7:08 pm

I guess if they are technically competent enough to find the hidden copy and to intuit its existence, then more power to them. You can only do so much. LOL.

jiml
Posts: 163
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: embedded audio clips pause

Post by jiml » Sat Sep 15, 2018 1:40 am

There should be another hidden copy of this 3Gb movie
somewhere in your Hard Disk or...
Did LiveCode memory requirements suddenly jumped
3 Gb more than before?
Or perhaps the memory requirements of a player are not limited by LC's memory requirements.

Jim Lambert

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”