天天看點

html5audio音頻自動緩沖,HTML5網絡音頻卡住了(緩沖問題?)(HTML5 web audio getting stuck (buffering issue?))...

HTML5網絡音頻卡住了(緩沖問題?)(HTML5 web audio getting stuck (buffering issue?))

我正在制作一個(每周廣播節目)音頻網站,我一直遇到同樣的問題,長達1小時的音頻檔案一直卡住。

我測試了幾個不同的播放器,包括Flash播放器Wimpy Player和HTML5播放器,如Audio5js,jPlayer和pickle播放器。

我已經測試了以不同的比特率8,24,64,128對聲音進行采樣,但聲音檔案一直卡住。 并非總是如此,但往往足以成為一個嚴重的問題。 該檔案開始播放但有一點(所有從幾秒到幾乎在1小時節目結束時)它隻是停止并且繼續播放的唯一方法是重新加載檔案。 對我來說,這似乎是一個緩沖問題。

我不明白為什麼。 如果有人遇到過類似的問題,請告訴我我錯過了什麼。

I am working on a (weekly radio show) audio website and I keep getting the same problem, the audio files that are up to 1hr long keep getting stuck.

I have tested several different players, both the flash player Wimpy Player, and HTML5 players such as Audio5js, jPlayer, and pickle player.

AND I have tested to sample the sound in different bit rates, 8,24,64,128 but the sound files keeps getting stuck. Not always, but often enough to be a serious problem. The file starts playing but a bit in (all from a few seconds to almost at the end of the 1 hr show) it just stops and the only way to keep playing it is to reload the file. To me it seems like a buffering problem.

I don't understand why. If anyone has ever had a similar problem, please tell me what I am missing.

原文:https://stackoverflow.com/questions/16432425

更新時間:2019-12-17 05:33

最滿意答案

我自己得到了答案。 經過雙重,三重,四重檢查後,我發現該網站由GoDaddy托管,我知道它并不是您能期望的最佳品質。 (實際上它們在很多方面都很糟糕。如果你能避免它,就不要跟GoDaddy一起去。隻是我的個人觀點。)我們改變了托管,問題就消失了。 糟糕的是,我花了幾天的時間無所事事。

I got the answer myself to this one. After double-, triple-, quadruple-checking everything it hit me, the site was hosted by GoDaddy and I know that it is not the best quality you can expect from them. (Actually they are really bad in more than one way. Never go with GoDaddy if you can avoid it. Just my personal opinion.) We changed the hosting and the problem was gone. To bad it had cost me days of work for nothing.

相關問答

您需要注冊要由MPMoviePlayerLoadStateDidChangeNotification通知的對象,然後通路電影播放器的loadState。 請參閱MPMoviePlayerController參考的通知部分。 You need to register an object to be notified by the MPMoviePlayerLoadStateDidChangeNotification and then access the loadState of the movie

...

這是一個應該幫助的要點: https : //gist.github.com/kevincennis/9754325 。 我沒有真正測試過這個,是以可能會有一個愚蠢的錯字或某事,但基本的方法将工作(我以前做過)。 實質上,您将直接使用Recorder.js中的網絡從業人員,以便您可以一次性處理一個大型AudioBuffer,而不是實時增量記錄。 我也會在這裡粘貼代碼,以防萬一出現問題。 // assuming a var named `buffer` exists and is an AudioB

...

我自己得到了答案。 經過雙重,三重,四重檢查後,我發現該網站由GoDaddy托管,我知道它并不是您能期望的最佳品質。 (實際上它們在很多方面都很糟糕。如果你能避免它,就不要跟GoDaddy一起去。隻是我的個人觀點。)我們改變了托管,問題就消失了。 糟糕的是,我花了幾天的時間無所事事。 I got the answer myself to this one. After double-, triple-, quadruple-checking everything it hit me, the si

...

I Solved the Issue by using Audio Object in JavaScript instead of using audio tag in html.

eg: var aud = new Audio();

aur.src = audioUrl;

aud.load();

I Solved the Issue by using Audio Object in JavaScript instead of using audio tag in html.

e

...

不,沒有辦法在腳本處理器中使用其他緩沖區。 今天,您最好的方法是使用腳本處理器并将樣本直接寫入其中。 請注意,AudioBuffers的工作方式,在以前的方法中無法保證不會複制和建立新緩沖區 - 您無法同時從音頻線程和主線程通路緩沖區。 将來,使用音頻工作器會好一些 - 它會避免一些跳線 - 但如果你(例如)從網絡源向下傳輸緩沖區,你将無法避免複制。 (實際上并不是那麼昂貴。)如果你正在生成音頻緩沖區,你應該在onaudioprocess中生成它。 No, there's no way to us

...

使用gst-launch playbin2 uri="some URL" buffer-size=size檢查gst-inspect playbin2擷取更多playbin2元素的屬性。 Use gst-launch playbin2 uri="some URL" buffer-size=size check gst-inspect playbin2 for more properties of the playbin2 element.

我有同樣的問題,但終于得到了解決方案! 問題是javascript節點cicle。 我建議你先改變createJavaScriptNode(): var levelChecker = context.createScriptProcessor(4096, 1 ,1);

垃圾收集器有“levelChecker”變量和他的onaudioprocess的問題,是以你必須将腳本處理器或onaudioProcess回調綁定到視窗。 這裡的HOLY SOLUTION: levelChecker.onaud

...

不要試圖繼續編輯相同的緩沖區 - 你将無法修改播放緩沖區(它有時在Chrome中運作,但這是一個錯誤)。 您應該将第一組塊緩沖到一個緩沖區中,就像現在一樣,以獲得一些延遲空間,然後當有額外的塊進入時,您應該将它們安排為單獨的AudioBuffer / BufferSourceNode組合。 (即跟蹤您開始播放第一個節目的時間和運作計數,并安排每個連續節點在最後一個節點結束時播放。) Don't try to keep editing the same buffer - you will not b

...

此代碼(jQuery)适用于iPhone Safari iOS7中的連續播放。 即使我的螢幕已鎖定/其他标簽,它也會在第一個結束時更改跟蹤(考慮到加載新軌道的一點耐心)

$('#audio1').on('ended',function(){

$(this).attr('src','song2.mp3');

$(th

...

同源政策指出,在某個源上運作的腳本無法讀取其他來源的資源。 (起源是一個域,加上一個方案和端口,如http://foo.example.com:80 。 請注意,同源政策不會阻止将交叉源媒體顯示給使用者。 相反,它可以防止腳本以程式設計方式讀取跨源資源。 考慮标記: example.com上的頁面可以顯示來自other.com的跨源圖像,但example.com頁面上的腳本無法讀取該圖像的内容。 使用者可以看到它; 該頁面不能。 Web Audio API可以讀取音頻檔案的内容。 如果音頻檔案來

...