9 Replies Latest reply on Mar 1, 2017 5:55 AM by Kookaburra308

    Creating an auto-playing sequence of audio tracks from a folder

    mendocinotim

      Title

      Creating an auto-playing sequence of audio tracks from a folder

      Post

      I have a folder path to audio tracks (MP3 tracks from an album) that I want to be able to play in Filemaker.

      Basically, I want to design an audio player that can play an entire album of tracks - going from track to track automatically.

      I am not storing the audio files in the filemaker solution, but separate: one album's worth of tracks per album folder. Where one Filemaker record is for one Album; with over 1000 albums (over 1000 records).

      Has anyone found a way to accomplish this?

        • 1. Re: Creating an auto-playing sequence of audio tracks from a folder
          philmodjunk

          Sounds like you need a related table of tracks linked to your table of albums. While I haven't tried it and FileMaker 14 has different options here than earlier versions, you should be able to insert a reference to your audio file into a container field in the tracks table.

          • 2. Re: Creating an auto-playing sequence of audio tracks from a folder
            mendocinotim

            Yes, that much I know how to do; but my question is more related to having the tracks play (in order) one after the other automatically - like CD players / MP3 players do. It's this sequential playing of tracks that I am really trying to figure out. Is it even possible to do?

            I think what I am asking is.. does anyone know how to set the audio player in Filemaker Pro Advanced 14 to automatically load and play the next track in a sequence of tracks - something like a script trigger, but for audio tracks? This has to work for Mac as well as Windows versions of Filemaker.

            • 3. Re: Creating an auto-playing sequence of audio tracks from a folder
              philmodjunk

              It's a very good question. (And my response will bump this to the top where others may see and respond to it.)

              A looping script can loop through the records and it should be possible to play each audio in turn but I think that you'd need to build a pause into that loop so that the script doesn't try to play the second track before the first is finished. But I'm guessing a bit here. It might be that you'd use a number or time field to record the playing time of each track in this table of tracks and use that to calculate a pause between each loop of the script.

              • 4. Re: Creating an auto-playing sequence of audio tracks from a folder
                FranGodfrey

                Do you want FileMaker to play the files? I have done something similar to this in FM 11 but FM doesn't actually play the files. This is done by a standard MP3 player (I used Media Player Classic).

                You can choose any number of tracks (stored reference to music files) in the FileMaker file; these tracks are sorted automatically to a predetermined order, and a looping script then transfers them to the MP3 player where this playlist is run automatically.

                • 5. Re: Creating an auto-playing sequence of audio tracks from a folder
                  mendocinotim

                  Can you tell me more about using "Media Player Classic"?

                  Where would I find it, and how did you implement it?

                  Thanks.

                  • 6. Re: Creating an auto-playing sequence of audio tracks from a folder
                    FranGodfrey

                    Information about Media Player Classic:
                    https://en.wikipedia.org/wiki/Media_Player_Classic

                    Can be downloaded from here (and many other sites):
                    http://sourceforge.net/projects/mpc-hc/

                    Portable version here:
                    http://portableapps.com/apps/music_video/mpc-hc-portable

                    Media Player Classic is the default audio/video player on my system, so this solution would probably work with other audio players.

                    The FM file is not a particularly sophisticated solution - it was thrown together just so that I could select music via FM to listen to while doing other FM work.

                    What it does:
                    selects tracks by adding a marker to a field [click a button]; finds all those tracks; sorts them and then a looping script moves them into Media Player where they are played.

                    The looping script is simply:

                    If [ Get ( FoundCount ) > 1 ]
                    Go to Record/Request/Page [ First ]
                    If [ not IsEmpty ( TRACKS::SongContainer ) ]
                    Go to Field [ TRACKS::SongContainer ][ Select/perform ]
                    End If
                    Loop
                    Go to Record/Request/Page [ Next; Exit after last ]
                    If [ not IsEmpty ( TRACKS::SongContainer ) ]
                    Go to Field [ TRACKS::SongContainer ][ Select/perform ]
                    End If
                    End Loop
                    Else
                    Show Custom Dialog [ Title: "Only one track"; Buttons: “OK” ]
                    Exit Script [ ]
                    End If

                     

                    • 7. Re: Creating an auto-playing sequence of audio tracks from a folder
                      mendocinotim

                      How did you embed the player in your filemaker solution?
                      I understand the code (above), but where do I add in that player?

                      One thing I forgot to mention is that this solution I'm working on will be distributed as part of a Filemaker runtime.
                      There will be two versions - one for mac, the other for PC.

                      Also, it looks like (from your code) that Media Player Classic will automatically recognize when a track is finished, so it can automatically sequence into the next track on its own, yes? I didn't think filemaker would do that - not without some kind of script trigger on the player itself to recognize when a track is done playing; but you didn't mention script triggers here, so I presume one is not needed.

                      Again.. thank you for your detailed response; I really appreciate your time.

                      • 8. Re: Creating an auto-playing sequence of audio tracks from a folder
                        mendocinotim

                        Okay - after several days of setting things up, I have so far worked out how to go to the next/prev tracks, using a script.

                        Basically the script does the following:

                               
                        1. Calculate the path to the parent folder where some mp3 files are contained.
                        2.      
                        3. List all the mp3 tracks in that folder.
                        4.      
                        5. Set a script that will go to the next mp3 track in that folder and assign that track to the player as a reference.

                        I have that much working so far.

                        My next task is to have the solution automatically goto to next track in the sequence when the current track reaches the end.

                        I have been trying to set a global variable to the GetAVAttribute( "duration" ) value 'thinking that if the duration is known, I could then compare that to the GetAVAttribute( "position") value to determine when that track has reached it's end.

                        In this example I am right now just trying to figure out how to make this work - that is 'if this is the best method to use to accomplish the end of getting each track (when it reaches it's end) to automatically go to and play the following track in the list.

                        I'm having no luck.

                        Here's 4min+ screen capture video that shows what I have set up, what I'm trying, and the (non) result I get.
                        https://youtu.be/8BeDKiCytVc

                        • 9. Re: Creating an auto-playing sequence of audio tracks from a folder
                          Kookaburra308

                          Dear mendocinotim,

                                                                I've been looking for a solution to a problem which I think mirrors yours. So far, the most interesting lead is a plugin called SimpleSound from a company called 24u. I have thousands of voice memo's in FileMaker 12, one memo per record, and I am looking for something that will enable me to play a selected group of them sequentially in much the same way as a CD player plays a selected CD. I would appreciate hearing from you as it sounds as if you must have found a solution for your situation.

                           

                          Regards

                           

                          Anthony J. Hudson