• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Info for Audio File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Info for Audio File


  • Subject: Re: Info for Audio File
  • From: Chris Adams <email@hidden>
  • Date: Fri, 19 Oct 2001 04:31:41 +0000

On 10/17/01 8:35 PM Brandon Carpenter wrote:
On 10/17/01 8:35 PM Brandon Carpenter wrote:

> Does anyone know of a scripting addition or a "vanilla" way of getting the
> playing time of a wave file?
> I have a need to gleen the Total Playing time of a sound file and write
> that to a database, but I need a
> way of doing this without having to open a soundplayer to get the
> information. Or is there a way to get
> QuickTime to run as a background application and just get the info I need
> without too much overhead?
>
>
> Brandon Carpenter
> 806-352-6370 X 107
>
Here is a droplet script that does this. A similar script can open and
close images really fast, <1 second per. The movies seem to open and close
just as fast on a G4: i believe that QT only needs to see the header
information.

Hope this helps.


-- available online (formatted) here:

http://www.cypresslakestudios.com/applescript/index.html#movielength



on open (droppeditem)

tell application "QuickTime Player"

set thealias to droppeditem as alias

open thealias
set mylength to duration of movie 1 as list


set movieLength to item 1 of mylength

set movieHours to movieLength div (600 * 60 * 60) -- seconds,
minutes, hours
set movieHoursRemainder to movieLength mod (600 * 60 * 60)
set movieMinutes to movieHoursRemainder div (600 * 60) -- seconds,
minutes
set movieMinutesRemainder to movieHoursRemainder mod (600 * 60)
set movieSeconds to movieMinutesRemainder div (600) -- seconds,
minutes
set movieSecondsRemainder to movieMinutesRemainder mod (600)

display dialog "movieHours: " & movieHours & return ,
& "movieMinutes: " & movieMinutes & return ,
& "movieSeconds: " & movieSeconds & return ,


close movie 1 saving no


end tell
end open


--
Chris Adams
Cypress Lake Studios
Hypermedia, Quicktime, and Internet Design
http://www.cypresslakestudios.com
email@hidden




> Does anyone know of a scripting addition or a "vanilla" way of getting the
> playing time of a wave file?
> I have a need to gleen the Total Playing time of a sound file and write
> that to a database, but I need a
> way of doing this without having to open a soundplayer to get the
> information. Or is there a way to get
> QuickTime to run as a background application and just get the info I need
> without too much overhead?
>
>
> Brandon Carpenter
> 806-352-6370 X 107
>
Here is a script that does this. A similar script can open and close images
really fast, about 1 second per. The movies seem to open and close just as
fast on a G4: i believe that QT only needs to see the header information.

Hope this helps.


-- available online (formattted) here:

http://www.cypresslakestudios.com/applescript/index.html#movielength



on open (droppeditem)

tell application "QuickTime Player"

set thealias to droppeditem as alias

open thealias
set mylength to duration of movie 1 as list


set movieLength to item 1 of mylength

set movieHours to movieLength div (600 * 60 * 60) -- seconds,
minutes, hours
set movieHoursRemainder to movieLength mod (600 * 60 * 60)
set movieMinutes to movieHoursRemainder div (600 * 60) -- seconds,
minutes
set movieMinutesRemainder to movieHoursRemainder mod (600 * 60)
set movieSeconds to movieMinutesRemainder div (600) -- seconds,
minutes
set movieSecondsRemainder to movieMinutesRemainder mod (600)

display dialog "movieHours: " & movieHours & return ,
& "movieMinutes: " & movieMinutes & return ,
& "movieSeconds: " & movieSeconds & return ,


close movie 1 saving no


end tell
end open


--
Chris Adams
Cypress Lake Studios
Hypermedia, Quicktime, and Internet Design
http://www.cypresslakestudios.com
email@hidden


References: 
 >Info for Audio File (From: "Brandon Carpenter" <email@hidden>)

  • Prev by Date: Re: No 'Result Window' in Script Editor (Mac OS X)
  • Next by Date: Edit the date Modified field
  • Previous by thread: Info for Audio File
  • Next by thread: RE: File Nmae to Bitmap
  • Index(es):
    • Date
    • Thread