從 WebAPI 在瀏覽器中播放 WAV 文件 (Play WAV file in Browser from WebAPI)


問題描述

從 WebAPI 在瀏覽器中播放 WAV 文件 (Play WAV file in Browser from WebAPI)

我有一個挑戰。我需要向用戶提供音頻以在網絡瀏覽器中收聽。

所以,我試圖開始解決方案。將音頻文件 (WAV) 提供給 html 音頻標籤播放的最佳方式是什麼?

問題是,當我將其作為 url 發送時,我認為客戶端應該首先需要下載所有內容,然後開始播放。我在想一些在下載數據時會運行的東西,比如流。

你有從哪裡開始的想法嗎?

我在想 Google Drive 附近的東西:

https://docs.google.com/uc ?export=download&id={GUIDFromFileFromGoogleDrive}<


參考解法

方法 1:

The thing is that when i send it as an url, i believe that the client should need first download all the content, and then start to play.

No, this is incorrect.

I was thinking something which will run while the data are downloaded, something like a stream.

That's how it works.

<audio src="https://example.com/your‑stream.wav" controls />

(by BisnetoBrad)

參考文件

  1. Play WAV file in Browser from WebAPI (CC BY‑SA 2.5/3.0/4.0)

#audio-streaming #audio #C#






相關問題

在 windows phone 7 應用程序中流式傳輸音頻 (Streaming audio in windows phone 7 app)

從 FFMPEG for android 的命令行版本訪問網絡攝像頭麥克風 (Accessing webcam mic from command line version of FFMPEG for android)

Siaran Langsung Node.js: Hindari buffering (Node.js Live Streaming: Avoid buffering)

Icecast 流媒體無法播放 (Icecast streamming not playing)

如何使用 NAudio 在 C# 中解碼 mp3 文件 (how to decode mp3 file in c# using NAudio)

在 Nodejs 中使用 Kurento 複合媒體元素進行音頻會議需要幫助 (Need help for audio conference using Kurento composite media element in Nodejs)

iPhone - 在顯示圖像時使用 UIWebView 流式傳輸音頻 (iPhone - streaming audio using UIWebView while displaying an image)

jQuery:跨瀏覽器問題——調試 Internet Explorer (jQuery: Cross-browser problem -- Debugging Internet Explorer)

在 xuggler 中轉發和倒帶音頻 (forwarding and rewinding audio in xuggler)

網站上的實時音頻流 (Live audio streaming on a website)

如何通過 NAT 流式傳輸 WebRTC 音頻? (How to stream WebRTC audio through a NAT?)

從 WebAPI 在瀏覽器中播放 WAV 文件 (Play WAV file in Browser from WebAPI)







留言討論