MP3 in 2010

Pavl

Registered User.
Local time
Tomorrow, 00:12
Joined
Jan 17, 2013
Messages
56
Hello to the forum.
Beginner using 2010.
I wish to play MP3 files from a command button on a form.
I would like to avoid third party / ActiveX controls if possible.
I am aware that use of "CurrentProject.Path" will be helpful to locate the MP3 file within a directory within the Project Folder.
But have be baffled by the sparse previous postings about this subject (going back to 2004).
Searching this forum yealds zero results on the term "MP3".
This accdb/e will be used to present historical information to a small number of people and will be used with runtime without user input.
And all I need is Play / Pause / Stop. No other functions required.
 
Office programs cannot natively play the mp3 format which is why you haven't found much about it. You can embed a media play control and use that to play files, or convert them to WAV files and use the windows sound APIs to play the files.
 
Thanks DJkarl
I have been playing with "Application FollowHyperlink" method which does work but relies on the installed payer default and always shows a Hyperlink Warning message.
So I am going to try your suggestions but have to learn about "ShellExecute" I think? - so it will take a while.
 
Reading the advice of some others and looking at the Windows Media Player SDK and Object Model I am now thinking along the lines of an embedded WMP control.

Using Shell and Execute may well solve the error messages but still relies on knowing the correct ".exe" for the application. As this DB is for runtime distribution and will be used in different countries I am returning to the idea of using the ActiveX embedded player.
This is much more likely to be on "any" other PC (unless someone bought the "N" version of XP.......)

So have got WMP to play a test MP3 file either on form open or on WMP controls.

However I cannot fathom the Object Model to see how I get the equivalent of "CurrentProject.Path & "\FolderName\" & [TxtControlName] & ".mp3" into the player as a URL.
Where [TxtControlName] has the correct file name without extension.
That way I can get the form controls to load the correct MP3 file without asking the user to select from some sort of list.
Have tried versions of this in the URL path and tried a bit of VBA but without success.

Out of my depth. Any help would be appreciated.
 
This maybe inappropriate but if you know html, you could create simple page just to play the MP3.

Simon
 
Thank you Simon_MT
Interesting suggestion - do you mean put a web browser control on the existing form?
Very happy to try this suggestion but I do not yet understand exactly what you mean and how to start.
 
Here is some code obviously some is superfluous. I use jwplayer (similar to flash player).
Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"             "http://www.w3.org/TR/html4/strict.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head> <title>Radio 3 Rainer Maira Rilke</title>
<meta name="description" content="Radio 3 Rainer Maira Rilke" />
<meta name="keywords" content="Poet Radio 3 Rainer Maira Rilke" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="icon" href="[URL="http://www.access-programmers.co.uk/forums/view-source:http://localhost/suehubbard/favicon.ico"]http://localhost/suehubbard/favicon.ico[/URL]" title="Sue Hubbard" /> <meta name="rating" content="General" /> <meta name="author" content="Designed Logic 2003-2013" />
<meta name="robots" content="all" />
<meta name="revisit-after" content="1 week" />
<link rel="stylesheet" href="[URL="http://www.access-programmers.co.uk/forums/view-source:http://localhost/suehubbard/include/artcritic.css"]http://localhost/suehubbard/include/artcritic.css[/URL]" type="text/css" /> </head>
<body>
<div class="container">
<div class="containerinner">
<div class="containertop"> <h1>Sue Hubbard</h1>
<h3>Poet and Broadcaster</h3> </div>
<div class="containertext"> <h2>The Sunday Feature</h2><img class="imageright" src="[URL="http://www.access-programmers.co.uk/forums/view-source:http://localhost/suehubbard/images/site/radio3.jpg"]http://localhost/suehubbard/images/site/radio3.jpg[/URL]" width="200" height="110" alt="Sue Hubbard Broadcaster Radio 3 Rainer Maria Rilke" />
<h4>Radio 3 - March 27, 2011</h4>
<h4>Among the Ranks of Angels<br />Rainer Maria Rilke</h4>
<h4>Poetry read by Tom Durham</h4>
<h4>Contributions from Philip Pulman,<br />The Archbishop of Canterbury, Rowan Williams<br />Poets Jo Shapcott, Don Paterson, and Sue Hubbard<br /> and the Professor of German Karen Leeder</h4>
<h4>Produced by Julian May</h4>
<div class="clear_left"><br /><br /></div>
  <div id="mediaplayer">
     <script type="text/javascript" src="[URL="http://www.access-programmers.co.uk/forums/view-source:http://localhost/suehubbard/jwplayer/jwplayer.js"]http://localhost/suehubbard/jwplayer/jwplayer.js[/URL]"></script>
         <script type="text/javascript">
             jwplayer("mediaplayer").setup({
             flashplayer: "http://localhost/suehubbard/jwplayer/player.swf",
               image: "http://localhost/suehubbard/images/misc/radio3_2011_rilke.jpg",
               width: 500,
               height:374,
                 levels: [
                  {file: "http://localhost/suehubbard/audio/radio3/Radio3_2011_Rilke.mp3"}
                  ]
             });
         </script>
</div>
<div class="containerbottom_1">Content and Texts © Sue Hubbard 2011</div>
<div class="containerbottom_2">Images maybe subject to copyright</div>
</div>
</div>

This does use a stylesheet.

Simon
 
Last edited:
Thank you again Simon_MT

Will give that a go over the weekend.
Your help very much appreciated.
I had managed to get the WMP version plating by using the URL line I found elsewhere but was having a few teething troubles.
So will test both methods and report back.
I am presuming the html code will work in runtime...
 
Hello Simon_MT

Have been reading up on the creation of html and the trials of others far more experienced than me.
Found some help and code and even a number of ways of having an html editor within Access.
But it seems that this method is way beyond my current abilities. But I will need this in the future when I attempt to put my DB on the web.
For now I will run with the WMP ActiveX version which is now functioning as required.
It will get tested on one basic "runtime" machine - and when that fails.......I will be back to your post to try to learn some more.
 
Yes, there is a bit of a learning curve, it you do get started just get the hang of html and css and progress gradually. I learnt the hard way through ASP - dynamic html - that was hard!

Simon
 

Users who are viewing this thread

Back
Top Bottom