get endTime of a word in an aiff file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
get endTime of a word in an aiff file
Hi All,
I have aiff files.
Each file contains one word in french and one in arabic with a silence (not absolute) between them.
(One is in attachment)
Is there a way to get the end (in milliseconds) of the french word and keep it somewhere in the file ?
Best
Jean-Marc
I have aiff files.
Each file contains one word in french and one in arabic with a silence (not absolute) between them.
(One is in attachment)
Is there a way to get the end (in milliseconds) of the french word and keep it somewhere in the file ?
Best
Jean-Marc
- Attachments
-
- manger.aiff.zip
- a aiff file with two words
- (84.37 KiB) Downloaded 294 times
https://alternatic.ch
Re: get endTime of a word in an aiff file
I'm sure it's possible. However, you'd need to understand how the AIFF file format works. Try googling for "AIFF specification", and read up on how the file is formatted.
After understanding what to do, you would use the binaryDecode and binaryEncode handlers to get the data that you want, modify it or replace it in the file.
Note that the AIFF format might or might not have the capability to store arbitrary data like timestamps. Again, you'd need to look up the specs, and then decide if you want to store it inside the file or just next to it as a seperate text file. (which I can assure you would be much simpler).
After understanding what to do, you would use the binaryDecode and binaryEncode handlers to get the data that you want, modify it or replace it in the file.
Note that the AIFF format might or might not have the capability to store arbitrary data like timestamps. Again, you'd need to look up the specs, and then decide if you want to store it inside the file or just next to it as a seperate text file. (which I can assure you would be much simpler).
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: get endTime of a word in an aiff file
Hi BvG,
Best
Jean-Marc
Thank. I look and i'l come backI'm sure it's possible. However, you'd need to understand how the AIFF file format works. Try googling for "AIFF specification", and read up on how the file is formatted
Best
Jean-Marc
https://alternatic.ch
Re: get endTime of a word in an aiff file
Hi BvG
I have read some documentation about aiff structure file.
It is probably possible to write the currentime of a player in a part of the file, but it seems delicate and obviously only valid for aiff file
I search a way which is useful for all sound types.
Is it a reasonable way to save the file as "frenchname_currentime_translation.aiff"
like this for arabic :
manger_550_adisha.aiff
fortunately the arabic word not with arabic font
Best
Jean-Marc
I have read some documentation about aiff structure file.
It is probably possible to write the currentime of a player in a part of the file, but it seems delicate and obviously only valid for aiff file
I search a way which is useful for all sound types.
Is it a reasonable way to save the file as "frenchname_currentime_translation.aiff"
like this for arabic :
manger_550_adisha.aiff
fortunately the arabic word not with arabic font

Best
Jean-Marc
https://alternatic.ch
Re: get endTime of a word in an aiff file
Hi All,
I test a way to store the seperate time code between two words in the name of the file
Comment and other ways are welcome
Best regards
Jean-Marc
I test a way to store the seperate time code between two words in the name of the file
Comment and other ways are welcome
Best regards
Jean-Marc
- Attachments
-
- PlayPartOfSound.zip
- (90.13 KiB) Downloaded 280 times
Last edited by jmburnod on Fri Sep 02, 2011 11:41 pm, edited 1 time in total.
https://alternatic.ch
Re: get endTime of a word in an aiff file
Hi,
Sorry
An error in the buildPath handler. I forget restaure the itemdel to ","
I change the attachment of my previous post
Jean-Marc
Sorry
An error in the buildPath handler. I forget restaure the itemdel to ","
I change the attachment of my previous post
Code: Select all
on BuildPath
put the filename of this stack into PathFol
set the itemdel to "/"
put "SoundArabicFrench" into item-1 of PathFol
set the itemdel to "," --restaure itemdel
set the defaultfolder to PathFol
put PathFol&"/"&"adisha_642_manger.aiff" into tPathFileSnd
set the filename of player sPlayer to tPathFileSnd
AjustWordTime tPathFileSnd
end BuildPath
https://alternatic.ch
Re: get endTime of a word in an aiff file
You can get "the duration" of a player, which will give you the total time of the sound file. The duration is not in seconds, so if you need to know the total seconds, then you must divide the duration by the player's timescale property.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: get endTime of a word in an aiff file
Hi Jacque,
Thank for your reply.
I don't need the total time in seconds.
I have two words in an aiff file, i search the best way to store the endTime of the first word
Best regards
Jean-Marc
Thank for your reply.
I don't need the total time in seconds.
I have two words in an aiff file, i search the best way to store the endTime of the first word
Best regards
Jean-Marc
https://alternatic.ch
Re: get endTime of a word in an aiff file
I see. You'll need to do that manually, but you only need to do it once during development. Load the sound file into a player and play it until the end of the first word, then pause it. In the message box or a button, get the currentTime of the player. That will tell you where the word ends. Then you can store number that anywhere you like -- in a field, a custom property, a text file, whatever is best for your stack. You can store the time in timescale units so that your scripts can use the number directly with the player later. You won't need to calculate seconds.
You could script a temporary stack with a player and a button that does this more quickly if you want. When the button is clicked have it stop the player and record the currentTime into a field.
You could script a temporary stack with a player and a button that does this more quickly if you want. When the button is clicked have it stop the player and record the currentTime into a field.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: get endTime of a word in an aiff file
Hi Jacque,
Thank. I'll do that.
Jean-Marc
Oh Yes. Why not two players in the same card and that should be more easy to compare the current and the new timeCodeYou could script a temporary stack with a player and a button that does this more quickly if you want. When the button is clicked have it stop the player and record the currentTime into a field.
Thank. I'll do that.
Jean-Marc
https://alternatic.ch