Boost WordPress Audio w/ Amazon S3
The Simple Storage Service (S3) from Amazon is an easy way to serve information. Its high availability and low cost make it a no-brainer when it comes to hosting.
Recently, a friend moved his website (the Astropope) from my server to that of a hosting company (for which he presently works). Along with his account comes 3 GB of storage, except he currently uses about 5 GB. To help with the transition, we decided to move the majority of content over to S3.
In order to do this, we got an account, uploaded everything, made a DNS record, and then ever-so-slightly modified a WordPress plugin.
The steps we took are detailed for your convenience:
1. Sign up for an S3 account.
2. Download, install & configure the S3Fox plugin for Firefox.
3. Amazon uses a bucket as a means for organizing information. You may refer to a bucket as a unique, top-level directory. Many directories may exist within a bucket, but the most absolute of those contained within is a ‘bucket’. Create a bucket named s3.[yourdomain].com. In that bucket, make an audio directory. So now we have something along the lines of s3.[yourdomain].com/audio.
4. Using S3Fox, upload your mp3 files to the newly created audio directory within the bucket.
5. Right-click the audio directory and specify an ACL with read access for public requests. Note: Without specifying an ACL w/ public read access, it won’t work.
6. Within WordPress, install the Audio Player plugin.
7. Once installed, modify the plugin as such:
edit audio-player.php
Under // Options Default add:
add_option(‘s3_url’, ”, “Amazon S3 URL”, true);
Under // Global variables change $ap_audioURL to:
$ap_audioURL = get_settings(‘s3_url’) . get_option(“audio_player_web_path”);
Under // Update plugin options add:
update_option(‘s3_url’, $_POST['s3_url']);
edit options-panel.php
<th width=”33%” valign=”top”><label for=”ap_audiowebpath”>Audio files directory:</label></th>
<td>
<input type=”text” id=”ap_audiowebpath” name=”ap_audiowebpath” size=”40″ value=”<?php echo( get_option(“audio_player_web_path”) ); ?>” /><br />
Recommended: <code>/audio</code>
</td>
</tr>
<!– snipit starts here –>
<tr>
<th width=”33%” valign=”top”><label for=”s3_url”>Amazon S3 URL:</label></th>
<td>
<input type=”text” id=”s3_url” name=”s3_url” size=”40″ value=”<?php echo( get_option(“s3_url”) ); ?>” /><br />
<?php $string = get_option(“siteurl”);
$url2 = substr($string, 7);
echo “(e.g. http://s3.” . $url2 . “)”; ?>
</td>
</tr>
<!– snipit ends here –>
Alternately, you can upload/replace with these pre-modified files:
wp-content/plugins/audio-player.php
wp-content/plugins/audio-player/options-panel.php
(be sure to rename from .ph_ to .php)
Login to WordPress, then go to Settings -> Audio player and add http://s3.[yourdomain].com to the new field below the audio files directory.
8. Add a cname (alias) at your domain registrar:
S3 -> bucketname.s3.amazonaws.com
(e.g. s3.[yourdomain].com.s3.amazonaws.com)
where S3 points to bucketname.s3.amazonaws.com. (TTL of 1 hr is acceptable.)
9. Post a song according to the directions for the plugin.
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Did it work for you? Did you run into any trouble? (I’d be happy to help you set this up if you’d like assistance.)
– Edit: 9.16.09 –
Version 2.0 beta 6 of the Audio Player plugin includes an option for a custom URL. When upgrading to this most recent version, there is no need to modify any source code. Nice!

Also, the most recent version of the WordPress S3 plugin version .4 adds a setting for virtual hosting:

Make sure you check the ‘Bucket is setup for virutal hosting’ box. If you see DNS warnings at the top of the plugin screen, refresh the page and it should go away (if you had this setup previously).

Comments(12)
Yeah, this works pretty good on my site so far. Nice choice of a song for the example above.
By the way, I should point out what Ben told me. If anyone is using Firefox, you’re gonna run into a little issue with the newer version of Flash not loading the audio.
If you uninstall it and roll back to a previous version, you should be in the clear.
No problem with IE, however.
http://www.oldapps.com/Macromedia_Flash_Player.htm
Hey Ben, this is exactly what I'm looking for! Problem is, I'm using Audio Player 2.0 Beta. Please fire me an email if you think you can help.
Hey Ben, this is exactly what I'm looking for! Problem is, I'm using Audio Player 2.0 Beta. Please fire me an email if you think you can help.
Excellent, just gotta recomend this….
got my thumbs up….
[...] this post. I run a small electronic music blog at astropope.com. If you have seen the post about how to boost wordpress audio with Amazon S3, then you know we are the guinea pigs to test a new breed of online music [...]
What if I want to play a playlist of music using JW player. Could you tell us how to modify the options in the wordtube plugin so that we could host audio and video content on S3? Amazing work by the way been searching for something like this for a while
Thank you so much for this post. I use the reviewazon plugin. Reviewazon is the easy and simple way to add amazon affiliate product to your website.
How long did it take you to write this blog.
i have just signed up with the amazon affiliate program and i am still not earning a good deal of cash from them.-;`
With a veritable army of Forex robots, trading courses, methods and pundits invading the net and ever newer techniques and indicators accessible it can make it tough to select the most beneficial tactic that fits you. But in the end your trading style should – and eventually will – reflect the sort of particular person you are otherwise it won’t operate.
If you are a ‘hands on’ kind of man or woman, who likes to understand the nuts and bolts of how something works, then – poor you – you may well need to tread the long and torturous path of learning how to analyse the markets yourself. Here are some tomes to graft: for a number of the bible of TA is Martin Pring’s “Techncial Analysis Explained”, but also try the well-liked “The Elliot Wave Principle” by Frost and Prechter, to catch those turns. Prefer buying and selling the news? Just Google it to acquire web sites related to fore.
If you are too busy to spend all day chart-gazing then you could test an automated trading approach. The Meta Trader platform provided by most mainstream brokers allows you to pre-programme your charting package to automatically take trades on your behalf. Wallet-friendly Forex broker’s are readily available there, just Google it to locate the ideal for you particularly with competitive spreads and a rebate on trading costs.
Or you can leave the hard operate of trading down to somebody else: Forex Robots are entirely hands free and need no prior knowledge to operate. There are numerous articles on the net covering the various systems accessible it can be observed very easily on world wide web. Make sure you do your research – there are some great robots out there but also a lot of incredibly poor ones as well. From what I have heard the better robots such as the ‘F.A.P’ range developed by Marcus Leary, seem to boast normal returns of anything up to 20% per month – which if true is pretty superior.
Whichever system you decide to use, on the other hand, there are some fundamental investment decisions you can’t avoid having to make without the aid of artificial intelligence.
And these decisions mainly boil down to bucks management, and whether or not or not to continue trading.
Once upon a time on Wall Street traders made millions buying and selling beans using a 10 day moving typical but attempt doing that now and see what happens! Ultimately almost every technique or robot has a lifespan but how can you tell if its finest days are over prior to you lose all your capital applying it?
Just one useful method is to chart your tactic or robot’s returns as an equity curve in excel or some other analysis package and analyse the equity curve to make decisions about whether or not to continue buying and selling. For example you could run a 50 day or 200 day moving average via your equity curve and when returns fall below the MA you switch off the method and wait until it comes back up over the MA prior to switching it back on. In fact you can use most of the chartist’s regular tools such as momentum, trend-line analysis and chart patterns to analyses your equity curve and this gives you further objective decision producing tools.
One more very good idea is to diversify, so that you have many tactics working simultaneously, that way if one particular fails the other’s will make up for the losses.
Cash management is the other fundamental area where traders can win or lose vast amounts. It can be tempting, for example, to increase your trade size after a winning streak – but be careful – it is frequently when approaches reach their peak performance that they are most vulnerable to having a sudden draw-down, just as peaks in the markets typically come at the latter stages of a trend. Again you need to have a definite approach for capital management with rules about how you manage risk. Don’t leave it up to your emotions – and never ever fall into the trap of thinking you have found a ‘golden goose’ due to the fact there isn’t one out there – you’re just playing the odds remember.
http://www.sutasi.com/community/member/18257/
Ok, I’ve had enough!
May you plz tell me what the name and artist of this song you used in your post are??? I’ve went through hell to find out but no use!
I know from the file properties that the name is: Open your Eyes… but I can’t find it anywhere online… searched the lyrics but no use. Help plz.
Thanks!
Confused