html5-audio

HTML5 audio is not playing in my React app in localhost

隐身守侯 提交于 2019-12-04 03:27:47
问题 I'm making an mp3 player with React.js and the HTML5 web audio javascript API. I've just been learning React for two weeks so I'm just getting used to the structure and setup (with components etc) however have several years experience with JavaScript. I had the mp3 player working when using React within the browser. I.e. I had an index.html file and I included the React scripts as follows: <script src="js/react.min.js"></script> <script src="js/react-dom.min.js"></script> <script src="js

Why does HTML 5 Audio disregards mobile device audio settings such as silent or volume?

混江龙づ霸主 提交于 2019-12-04 03:08:19
I have a site that targets mobile android users. I’m using the HTML5 audio to play background music. The audio is played even if the device is on silent; also the audio is played in the highest volume regardless of the device volume settings. Does anyone know why these things happen or how to get the device current audio settings? I’d prefer a client side (javascript) solution but I’m open to all solution. Thank you for your help Moshe S. In Android, even if the phone is on silent, the media volume will not change. I'm not sure if android allows for the modification of the system sound

Does removing html5 media elements also remove memory used by the video/audio?

若如初见. 提交于 2019-12-03 21:39:08
Does removing an html5 media DOM element (video or audio) also free any memory used by the media represented by that element? (assuming no references in code also) From the specification: 4.8.10.16 Best practices for authors using media elements Playing audio and video resources on small devices such as set-top boxes or mobile phones is often constrained by limited hardware resources in the device. For example, a device might only support three simultaneous videos. For this reason, it is a good practice to release resources held by media elements when they are done playing , either by being

Fallback solution for HTML <audio> and legacy browsers

点点圈 提交于 2019-12-03 21:36:23
I am working on creating a sound board with various audio clips. Rather than using the standard HTML5 audio controls, I want to style each button with some title text, so that when a user presses a button, the associated clip plays. Everything is working fine in HTML 5 browsers (Chrome, Firefox, Safari, and IE9+), using the following code: <script type="text/javascript" charset="utf-8"> $(function() { $("audio").removeAttr("controls").each(function(i, audioElement) { var audio = $(this); var that = this; //closure to keep reference to current audio tag $("#doc").append($('<button>'+audio.attr(

How can you create an auto playlist with the HTML5 Audio tag?

∥☆過路亽.° 提交于 2019-12-03 21:31:01
How can you create an auto playlist with the audio tag from HTML5? What I'm trying to achieve is a player with only the play/pause button big 30x25 px, the player autoplays when the page loads and when the song ends it'll play the next song automatically. Trying to have 3-4 songs in a playlist. shanabus Check out this post: using jquery + <audio> w/ php/mysql to loop playback times var sfx = new Audio('sfx.wav'); var sounds = a.addTextTrack('metadata'); // add sounds we care about sounds.addCue(new TextTrackCue('dog bark', 12.783, 13.612, '', '', '', true)); sounds.addCue(new TextTrackCue(

meteor upload a file to mongodb

泪湿孤枕 提交于 2019-12-03 21:25:06
I am trying to find a way to upload an mp3 file into a mongo collection through my meteor collection. Its a bit challenging as I end up with "C:\fakepath\audio.mp3" as what is saved in the collection. Any help is greatly appreciated. Thanks. Ethaan You are looking for the FSCollection Package , and the GridFS Storage Adapter. to get started run this on the console. meteor add cfs:standard-packages meteor add cfs:gridfs now With fsCollection you can upload files simple as. First Declare the Collection. AudioCollection = new FS.Collection("AudioCollection", { stores: [new FS.Store.GridFS(

Is there a good radio-like audio streaming solution for node.js?

流过昼夜 提交于 2019-12-03 20:25:24
问题 I'm looking for something to stream audio like radio (playing continuously and clients can join in the middle of a song) with node.js. Is there any node.js module (which I couldn't find)or anything else that I can use along with node.js to achieve this? Is this possible at all with node.js? If not, what do you recommend to use otherwise? (though, I prefer node.js) It's ok for me to use HTML5 Audio API and I don't care about IE support. Thanks. 回答1: Yes, this is entirely possible. I am hosting

In HTML5, can I play the same sound more than once at the same time?

妖精的绣舞 提交于 2019-12-03 19:13:22
问题 I'm making a game, in which sounds are often played. I noticed that a sound wont play again while it is being played. For example, the player collides with a wall, a "thump" sound is played. But, if the player collides with one wall, and then quickly collides with another wall, only one "thump" sound is played, and I believe that this happens because the first sound didn't finish. Is that true? How should I avoid this? I thought of preloading the sound three times, always playing a different

Only allow one audio element to play at a time

六月ゝ 毕业季﹏ 提交于 2019-12-03 17:05:33
I have multiple audio players, each with a play and stop button, on one page. The only issue I have is when you click one play button, and then another, they play on top of one another. Can someone help me with the code I would need to stop whatever song is playing when another play button is clicked - so there would never be more than one song playing at a time?? Thanks! Here is my code: $(document).ready(function(){ $("#play-bt").click(function(){ $("#audio-player")[0].play(); }) $("#stop-bt").click(function(){ $("#audio-player")[0].pause(); $("#audio-player")[0].currentTime = 0; }) }) $

Using <audio> element for playback of raw audio

℡╲_俬逩灬. 提交于 2019-12-03 15:23:39
I'm working on a little project that decrypts (using openpgp.js) and decodes a server-side audio file using the Web Audio API. The decrypted file arrives to the client as raw audio. Currently I can play back audio files using source.start(0) but there doesn't seems to be an easy way to dump the audio to a GUI that would allow users to do things like adjust volume and seek through the audio. I have a AudioContext object that's decoded and buffered with createBufferSource function playSound(decodedAudio) { var source = context.createBufferSource(); source.buffer = decodedAudio; source.connect