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: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
bidgeeman
- Posts: 495
- Joined: Wed Feb 21, 2007 7:58 am
Post
by bidgeeman » Sat May 30, 2009 11:03 am
I am experimenting with different audio codecs and I'm stuck on this one and can't figure it out.....
I'm trying to load an mp3 into QTExternal and save it out as another file type available in QTExternal. The below code works but pops up a screen that asks you to select a source file to load before the conversion screen comes up. I'm trying to preload an mp3 into "gIndAudio" so you don't get that first screen.
As soon as I take out "answer file "Select audio file" Nothing works. I've tried "put "C:\Test\test.mp3" into gIndAudio but tha won't work. I tried it with filepath...etc but nothing.
How to I hardcode the filepath of the mp3 directly into gIndAudio without the "answer file"?
Code: Select all
global gIndAudio
on MouseUp
set the filename of player "Player" to empty
answer file "Select audio file"
put it into gIndAudio
set the filename of player "Player" to gIndAudio
put movieControllerID of player "Player" into mc
qtInitializeEditing mc
qtSelectAll mc
qtCopy mc
qtInitializeEditing mc
qtExport mc
end MouseUp
end MouseUp
Many thanks again
Bidge
-
bn
- VIP Livecode Opensource Backer

- Posts: 4172
- Joined: Sun Jan 07, 2007 9:12 pm
Post
by bn » Sat May 30, 2009 12:26 pm
bidge,
I think it has to do with the backslashes you use in your pathname.
one way to get a correct pathname that Rev can handle is
Code: Select all
on mouseUp
answer file "please choose..."
put it
end mouseUp
and copy the content of the message box and hard code that into your script. That is not elegant but unfortunately I dont know how to do the correct windows pathnames.
You could have the global filled in an extra button. That would be more flexible, unless you alway want that one file to be loaded into the player.
regards
Bernd
-
bidgeeman
- Posts: 495
- Joined: Wed Feb 21, 2007 7:58 am
Post
by bidgeeman » Sat May 30, 2009 12:36 pm
Hi Bernd.
I tried this script with the right file path name but it does not work?
Code: Select all
global gIndAudio
on MouseUp
set the filename of player "Player" to empty
put "C:/Test.mp3" into gIndAudio
set the filename of player "Player" to gIndAudio
put movieControllerID of player "Player" into mc
qtInitializeEditing mc
qtSelectAll mc
qtCopy mc
qtInitializeEditing mc
qtExport mc
end MouseUp
end MouseUp
Cheers
Bidge
-
Klaus
- Posts: 14198
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Sat May 30, 2009 12:40 pm
Hi friends,
internally Rev always uses the UNIX style for pathnames with slashes!
Windows:
C:/Test/test.mp3
Mac:
/Volumes/Disk_Name/Downloads/brulev.mp3
So setting the filename to something like the above will sure work in your handler.
Best
Klaus
P.S.
Will answer the QT Export question a little later this day.
-
Klaus
- Posts: 14198
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Sat May 30, 2009 12:41 pm
Hi bidge,
looks like we posted at almost the same time
What exactly does "not work" in your handler?
-
Klaus
- Posts: 14198
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Sat May 30, 2009 12:44 pm
BTW: No need to inititalize the QT Editing/Select all etc.. for the export!
-
bidgeeman
- Posts: 495
- Joined: Wed Feb 21, 2007 7:58 am
Post
by bidgeeman » Sat May 30, 2009 12:46 pm
Hi Klaus.
As soon as I delete the line :
and replace it with:
It stops working?
I thought t should be the same just to put the file name of the mp3 directly into gIndAudio but it seems not?
Chers
Bidge
[/quote]
-
bidgeeman
- Posts: 495
- Joined: Wed Feb 21, 2007 7:58 am
Post
by bidgeeman » Sat May 30, 2009 12:54 pm
Oh...it works...I just deleted the qtinitializa and QTselectall and it worked
Thanks
Bidge