Search the Community
Showing results for tags 'audio'.
-
I have php code that uses mp3 audio files stored in a database for the user to listen to. The page loads and the audio controls work and the files play on a desktop and laptop just fine. When trying to play a file on an android or IPhone, when you press the play (or any other control) nothing happens. It acts like the page is static. There is a home button on the webpage and it works so I know the page is interactive. Below is the code. I would appreciate any help. Thank you. <?php $sermons = $database->select("sermon","*");; foreach( $sermons as $sermon ) { $audio_file = 'http://xxxxxxx.com/sermons/'.$sermon['file_name']; $player = "<audio id='sermon_'$sermon[id] controls> <source src='$audio_file' type='audio/mpeg'> <source src='$audio_file' type='audio/mp3'> Your browser does not support the audio element. </audio>"; echo "<tr> <td>$sermon[sermon_date]</td> <td>$sermon[title]</td> <td>$sermon[speaker]</td> <td>$player</td> </tr>"; } ?>
-
Hi, In an earlier topic I was trying to get the sounds to play off the server. The sound file being served by the server. Eventually I have a situation where I have finally managed to get the sound to play within the ajax block. The lines of code shown execute and the sound is played. However if I try and pass the audio object back to the calling function (// return audio) it ends up in the calling code as undefined !??? Could this be because of the asynchronous nature of ajax ? If so, Is there a way to get around it and pass the object back to the calling function successfully? <script> $(document).ready(function(){ $('.btn').click( function() startSound(); }); function startSound() { $('.btn').disabled = true; playURL = getURL(); audio = playServerURL(playURL); console.log(audio); --------------------------------- ( ERROR--A ) // alert("Received Data"); // var audio = new Audio(playURL); // audio.type = 'audio/mpeg'; // audio.play(); // audio.onended = getNextUrl; } // Get sounds off the server $.ajax({ type: 'GET', url: 'playsound1.php', data: {sf: 'ready.mp3'}, dataType:"binary", success:function(data){ // doesn't trigger alert("Yey !"); // does not popup . . . audio = new Audio(audBlob); var audio = new Audio(audBlob); // return audio; audio.type = 'audio/mp3'; console.log(audio); -------------------------------------- (Message B) audio.play(); } }) }) </script> console.log() inside the ajax (Message -- B) gives the audio object console.log() inside the startSound gives (Error -- A) :- Please can someone shed light on this. Thanks all !
-
Hello, I have been looking for a way to track the play stats on audio mp3's in the admin of my custom post-type. Whatever I google seems to come up with nothing. I not very versed in audio player code - could someone please point me in the right direction. Again: I have a custom post-type which uses the wordpress default audio. I would like to get the number of plays for each audio file and display that in the admin column for my custom post-type Thanks, Drew
-
I have this function call I want tied directly into a var: startTone( tone ); How would I tie it into a var similar to how I have this var created: audio = new Audio(); audio.src = "sound.mp3"; audio.loop = false; audio.play();
- 11 replies
-
- tone
- javascript
-
(and 1 more)
Tagged with:
-
Hi, how to get thumbnail image from mp3 / audio files? i am using html with php. Thanks
-
is there a library that can convert between these filetypes: mp3, wav, ogg, webm thanks, dsdsdsdsd