Move audio clip to another stack

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

Move audio clip to another stack

Post by Ron Zellner » Thu Dec 04, 2008 5:25 pm

I have a stack with an audio clip that I want to use in another stack- but I can't find my original audio file-
Is there a way to export/extract the resource, or copy it to the other stack?

Thanks.

Ron

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Fri Dec 05, 2008 12:57 pm

It's been ages since I used clips, but they're considered objects, so all object manipulation tasks should be possible on them, including "copy" and "clone".

As for exporting, I don't know a build in way, but there are applications that can insert themselves into the audio output and record any sound coming out of the speakers, for example "Audio Hijack" for Mac OS X.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Dec 05, 2008 1:29 pm

Hi Ron,

Try this:

Code: Select all

put the text of audio clip "blabla" into url "binfile:<path to a new file>"
(where you have to replace <path to a new file> with a valid file path). Now you can import this file into any other stack.

It would, indeed, also be possible to copy or clone an audio or video clip.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

I'm trying that

Post by Ron Zellner » Fri Dec 05, 2008 5:17 pm

when I use:

put the text of AudioClip "Open.wav" into URL "binfile:/Open2.wav"

I get:

Message execution error:
Error description: Object: object does not have this property


When I use:

put AudioClip "Open.wav" into URL "binfile:/Open2.wav"

It produces a file, but it is a Text file with the same content as the message used:
put AudioClip "Open.wav" into URL "binfile:/Open2.wav"
I tried to use copy, but the only place I can access/see it is in the Application Browser and there is no Copy function there (grayed out) (AudioClips have no user interface)

Yes, I can capture it with WireTap Pro or SnapZ, etc. but I'd like to figure out how to move them.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Dec 05, 2008 6:07 pm

Hi Ron,

You're right, you can' export audio clips, only video clips. I have posted a bug concerning this problem http://quality.runrev.com/qacenter/show_bug.cgi?id=7515

With being able to copy, we mean that you can use the copy command. We don't mean that you can select Copy from a menu.

Code: Select all

copy audioClip 1 to stack "A new stack"
This should work. You can execute it from the message box or a script.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

Tried it

Post by Ron Zellner » Fri Dec 05, 2008 6:31 pm

Gee, that was easy! :oops:

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Fri Dec 05, 2008 11:55 pm

The hard part is always finding the right command, or if there is none to do the task. The simple part is using the command, and the extremely hard part is to make your own when there is none :)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply