I do not want to put the audio into a container field as this database has over 40k records and will only get larger.
Try inserting or importing these files into container fields, but use the "store by reference" option so that you store only the file path to the files. It would take some trial and error to get it to work, but I suspect you can use a replace field contents step to move the filepaths from the current field into the container field, formatted to work within the container field.
The secret behind this is that you can manipulate the data stored in a "by reference" container field via Repalce field contents or Set Field just as though it is a text field instead of a container field. You may want to insert one sound file "by reference" manually and then examine the text stored in the container field to figure out the format that you'll need to make this work. (getasText can display the contents of the container field as text.)
I tried inserting it into a container field and nothing happens.
I have had a bit of iffy success using a Send Event Script step. However, logging out and back in on the computer seems to destroy whatever happens to make the VLC player play the file.
According to VLC, I should be able to use "vlc filename" to open and play the file. So the calculation looks like this:
filepath=field name with the path to the audio file.
As I said, I get this to work, but then the next time I log in, I get a message that says "The file "vlc" could not be found and is required to complete this operation. If i try to put the entire path it says that "C:/Program" can't be found. Evidently this is because you cant have spaces in these calculations/commands.
It's extremely frustrating to get this to work only to lose it because you've logged out.
I tried inserting it into a container field and nothing happens.
Exactly how did you try to do this?
As a test, click on a container field and use Insert QuickTime to insert a reference to your audio file into the container field. The click on the field and try to play back the sound.
Insert QuickTime only inserts files by reference so all such inserted files must remain in the location where they were when you inserted and the file name cannot be changed.
I inserted the filepath through Insert File and selected "store only as reference to file."
If I use the Insert Quicktime, it seems to be putting the media there because the file size increases. Also the field appears blank until I click on it several times.
Further, I have over 40k records in this database, and there doesn't seem to be a way to put in the pathnames inserted as a quicktime through either a calculation, look-up etc.
So inserting as a QT seemed to be less preferable than creating a script that would play the file.
Insert File won't work. Insert QuickTime should. It does not insert a copy of the file according to FileMaker help, only a reference to the file.
The fact that the file appears empty when sound files are inserted in this manner is a valid concern. Some developers use conditional formatting to create what appears to be an icon that is only visible when there is a reference inserted into the ocntainer field.
It is possible to move the file paths from a text field into such a container field, but the file path must be modified to use the correct syntax.
With a container field loaded via Insert QuickTime, Go TO field with the select/perform option is a one step script to play the sound.
The Insert Quick Time still isn't doing it for me. I can find no way to Insert the QTs at one fell swoop. The only thing I'm finding that works is to do it one at a time -- which isn't practical given the fact that I have over 40,000 records in this database. This was the reason I was trying to develop a script that would take the filepath and open either VLC or QT and open and play the file.
I did try making a one-step script using Go To Field:
Go to Field[Select\perform; SFX::pathcontainer]
I only get it to play occasionally (and not very loudly even though audio is all the way up) and every time it freezes FM and I have to force quit it.
Is Your install of quick time up to date? Just need to rule that possible issue out.
Don't know why it would freeze FileMaker on you here.
If you can get Quick Time to work, there's a way to use the data in the fields you already have to set up the references in the container field in a batch operation--something that I've already mentioned in this thread, but there's no point in going there if you can't get the sound files to play effectively from the container field.
There are three other ways that you can try for opening the sound file:
Open URL and Send Event--which you've already tried, and you may be able to get a webviewer to open and play the sound file if you can construct a URL expression that successfully finds and opens the sound file. I've opend PDF files this way from a PDF stored in a container field so the curretn file path you have in a text field should be a starting point for setting that up.
Ok, I'm back on this. I still have a few issues:
1. If I Insert Quicktime the "control bar" disappears. So, if i start playing a sound, I can't stop it. I can't find anything in conditional formatting or anywhere else which would stop bar from disappearing or allow me to stop the file before it's finished playing.
2. In a previous post, you said that it was possible to get these all inserted as QTs but i've had no luck with this either. So far, it's been one at a time. In a previous post you said, "It is possible to move the file paths from a text field into such a container field, but the file path must be modified to use the correct syntax." What is the correct syntax? My files are all located in a directory on our network like: G:\library\editing\sfx_library. Is there something else which should be done to it?
If I Insert Quicktime the "control bar" disappears.
Not having inserted audio or movie files myself, I'm suprised to learn this. I would have expected click on or hoverin over the container field would bring back the control bar. Anybody out there know what to do about that?
It's also possible to use a web viewer to view movie files, and the URL expression set up in it can construct the needed reference from the data in your container field or your text field with the filepath. (Just gave you an alternative to using a container field.)
In a previous post, you said that it was possible to get these all inserted as QTs but i've had no luck with this either.
Use Import Records | Folder with the "picture and movie files" option to import a folder of audio or movie files into a table in your database.
What is the correct syntax?
I suggest looking up Container Fields in Filemaker help where you can find examples of the filepaths created by the various insert options. You can also set up a calculation field where you use the name of your container field as the only term in its calculation. Specify Text as the return type and put it on your layout, sized several rows of text tall, next to your container field. You can then insert an audio file and this calculation field will show you the format of the file reference stored in the container field.
Play external audio file through script in FM
posted by Sam Patterson
posted September 26, 2011 and, last edited February 10, 2012Sam,get FileMaker 24u SimpleSound plugin to PLAY PAUSE sounds referencing file paths AND does much much more.A very simple productive plugin that expands audio capabilities in FileMaker. you can even play several sounds at one time. Check it out!! REALLY WORTH IT !!H E A R T L A N DAMERICAr o b Jesus Land Tidd l e w i sarchitect visionary for hardware software