Turns out I had to iterate over the messages and call tumblr api to get the code to insert the sound.
I put the code below, hope this helps someone:
I have the following html code in a tumblr theme:
{block: Messages}
<div id="{PostID}" class="posts {block:Photo}photo-post{/block:Photo} {block:Video}video-post{/block:Video} {block:Audio}audio-post{/block:Audio} {block:Photoset}photoset-post{/block:Photoset}">
(. ) :
$('.audioplayerinto').each(function(){
var audioID = $(this).attr("id");
var $audioPost = $(this);
$.ajax({
url: 'http://myblog.tumblr.com/api/read/json?id=' + audioID,
dataType: 'jsonp',
timeout: 50000,
success: function(data){
$audioPost.html(data.posts[0]["audio-player"]);
}
}
:
if($content.infinitescroll) {
$content.masonry({
itemSelector: '.posts',
isAnimated: true
}),
$content.infinitescroll({
navSelector : 'div#pagination',
nextSelector : 'div#pagination div#nextPage a',
itemSelector : '.posts',
loading: {
finishedMsg: '',
img: 'http://static.tumblr.com/dbek3sy/pX1lrx8xv/ajax-loader.gif'
},
bufferPx : 500,
debug : false,
},
function( newElements ) {