You don't "download" from anything that's already on your computer. You're wanting to extract or export the audio from the FLA.
You can export media files from Animate using a script. Copy the below code into a blank text file and save it as "Export Media from Library.jsfl". Place this file in Animate's Commands folder. On a Windows machine this will be located at:
%LOCALAPPDATA%\Adobe\ <your Animate version> \en_US\Configuration\Commands
/*
Export Media from Library
DOCUMENTATION
To use, select a folder or media symbol(s) in the library, then in the Commands
menu select Export Media from Library.
Media files will be saved in the same folder as the FLA, using (if possible)
the original import filename. If there is no original name (e.g. a bitmap that
was pasted directly into Animate), the library name will be used.
*/
// ======================================================================
// script configuration globals
var _dom = fl.getDocumentDOM();
var _lib = _dom ? _dom.library : null;
var _exportPath;
// ======================================================================
// primary script processing
function main() {
// sanity check
if (!_dom) {
message("ERROR: No document open.");
return;
}
// working variables
var i, alen, count, rawPath;
var items = [];
var rawItems = _lib.getSelectedItems();
var rlen = rawItems.length;
// make sure something selected
if (!rlen) {
message("ERROR: Must select one or more media symbols or folders in the library.");
return;
}
// build conversion list
for (i = 0; i < rlen; i++) {
if (["sound", "bitmap"].indexOf(rawItems[i].itemType) != -1) {
items.push(rawItems[i]);
}
}
alen = items.length;
// make sure something to convert
if (!alen) {
message("ERROR: No media (bitmap or sound) symbols selected.");
return;
}
// determine export path
rawPath = _dom.pathURI;
if (!rawPath) {
message("ERROR: This document has no save location.");
return;
}
i = rawPath.lastIndexOf("/");
_exportPath = rawPath.substr(0, i + 1);
// do the thing
count = 0;
for (i = 0; i < alen; i++) {
exportSymbol(items[i]);
count++;
}
// all done
message("Exported " + count + " media file" + (count != 1 ? "s" : "") + " to .FLA folder.");
}
// ======================================================================
function exportSymbol(sym) {
var i, symName, success;
// determine output name
symName = symNameOnly(sym.sourceFilePath);
if (!symName || symName.indexOf("Bitmap%20") == 0) {
symName = symNameOnly(sym.name);
}
// process as either bitmap or sound
if (sym.itemType == "bitmap") {
symSave(sym, symName, sym.originalCompressionType == "photo" ? "jpg" : "png");
}
else {
success = symSave(sym, symName, "wav");
if (!success) {
// some compression types can only be exported as MP3
symSave(sym, symName, "mp3");
}
}
}
// ======================================================================
// export symbol to file without overwriting any existing file
// return success flag
function symSave(sym, name, ext) {
var iterCount = 0;
var fullPath = _exportPath + name + "." + ext;
while (fl.fileExists(fullPath)) {
fullPath = _exportPath + name + " (" + ++iterCount + ")" + "." + ext;
}
return sym.exportToFile(fullPath);
}
// ======================================================================
// strip path and extension from symbol name
function symNameOnly(symName) {
// strip path (if any)
i = symName.lastIndexOf("/");
if (i != -1) {
symName = symName.substr(i + 1);
}
// strip extension (if any)
i = symName.lastIndexOf(".");
if (i != -1) {
symName = symName.substr(0, i);
}
return(trim(symName));
}
// ======================================================================
// remove leading and trailing whitespace from a string
function trim(str) {
var w1 = 0;
var w2 = str.length - 1;
while (w1 <= w2 && str.charCodeAt(w1) < 33) w1++;
while (w2 > w1 && str.charCodeAt(w2) < 33) w2--;
return str.substring(w1, w2 + 1);
};
// ======================================================================
// display and log a message
function message(txt) {
alert(txt);
fl.trace(txt);
}
// ======================================================================
// run script
main();
Once the script is installed, you can select the assets or folders you want to export in Animate's library, then select the script from the Commands drop-down menu. The exported files will be saved in the same folder as the FLA.
...その他を表示