Hi,
I want to open an m4a-audio-file in Quicktime and save the audio-content to a new created m4a, leaving the audio-content untouchen (no reencoding!).
First I tried this:
tell application "QuickTime Player"
open POSIX file "/PathToFile/Original.m4a"
save self contained front document in POSIX file "/PathToFile/New.m4a"
end tell
Well, this code worked well so far, but then I found out, that the resulting file is in fact a quick-time movie and no MPEG-4 audio-file (Hex-Editor, and some other applications say “sorry, no, do not work with video files”). For compatiblity reasons I would prefere an audio-file, and not a video.
Then I tried this:
tell application "QuickTime Player"
open POSIX file "/PathToFile/Original.m4a"
export front document to POSIX file "/PathToFile/New.m4a" as iTunes with replacing
end tell
OK, now the result was a MPEG-4 Audio-File, but the content was transcoded.
I think I need to add the “using settings preset” option to the export statement, but I have no clue which preset I need to use to keept the audio-content untouched (“pass through”). All links to the quicktime-applescript guide seems to be brokens, so I could not find anything helpful until today.
Any ideas?
Thanks
Model: iMac
Browser: Firefox 2.0.0.14
Operating System: Mac OS X (10.5)
Hi,
is just duplicating and renaming the file not the same thing?
The m4a-files I have are somehow non-standard and contain contradicionary information inside. With that process I want to make them standard again.
But you could extend the problem as follows:
I want to save/export only a part of the original track, because the original file consists of muliple tracks which I want to separate losslessly, and I don’t want to use fission, because after splitting with fission, the result does not play gapless in iTunes, but that’s another story, so I want to give applescript and quicktime a try.
I wrote a bunch of quicktime scripts. This one should help you or you can modify it to suit your needs.
http://bbs.macscripter.net/viewtopic.php?id=21480
Thank you but I want to use quicktime to manipulate audio-files and no video-files.
It would really help If someone could point me to a tutorial which explains, which options the “export … using settings preset …”-statement has.
Thanks
Audio versus video doesn’t matter. The basic process is the same. In that script it pulls out the tracks of a file and makes a new quicktime file out of those tracks… which is what you wanted I thought. You just need to go through it and pull out what you need.
Well, it does matter.
The created file will be a Quicktime Movie, and not a M4A-File.
You can check this if you open the files with a hex-editor.
“ftypM4A” will be changed to “ftypqt”
So: How can I save the file and preserve the file-type?