• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

How to share uncompressed audio with player on ASR etc.?

Multicore

Major Contributor
Joined
Dec 6, 2021
Messages
1,997
Likes
2,209
I want to share uncompressed PCM audio clips that you can play with one click/touch here on ASR and other such forums (and DL if you want).

Does anyone know a service that does that like YouTube does for video or Imgur does for images? Soundcloud comes close but 1) requires an account to upload, 2) requires requires listeners to login to get full interactive control, 3) is very limited without paying.

I wouldn't mind hosting the audio myself, say on AWS S3, but I also want an embedded web player so you can listen, pause/resume, seek while composing a reply on the same page. But my self-hosting doesn't permit you to share your uncompressed audio.

Is there an auth provider for XenForo we could use to allow logged in ASR members to upload?
 
GDrive has a web player for uncompressed audio that you can share with anyone via a simple link, no login required.

I can test later today if it it truly plays back the uncompressed audio or whether there's a re-encode step in between.
 
Google drive is ok but the example you gave is a link to a non ASR Web site. It's there a way to embed a media player for same?
I think this is the best we will get below. embedding via iframes are possible on these message boards, but I doubt general users will be given that sort of access. There are some talks about 3rd party players, but that would have to be implemented by amir and the team.

Maybe look into publishing on apple music, as they have lossless, and embedding works.


[MEDIA=site] - Embedded Media Embeds media from approved sites into your message. It is recommended that you use the media button in the editor tool bar. Approved sites: Apple Music, Can I use, Dailymotion, Facebook, Flickr, Giphy, Imgur, Instagram, Pinterest, Reddit, SoundCloud, Spotify, TikTok, Tumblr, Twitch, X, Vimeo, YouTube Example: [MEDIA=youtube]kQ0Eo1UccEE[/MEDIA] Output: An embedded YouTube player would appear here.
 
It looks like FLAC works in an <audio> element in the popular browsers, which provides a satisfactory player UI. And allowing that element seems more a config job than a coding one https://xenforo.com/community/resources/post-content-find-replace.1549/ Then if I provide a URL and server that responds with audio/flac content type then we're off to the races for the player side. If GDrive does the server part (idk) then I could live with that.
 
I have an Asus router and Merlin firmware and it's got a cloud hosting built in to share files on the Internet. Google and OneDrive gives 15gb per account and you can share links that way also.
 
It looks like FLAC works in an <audio> element in the popular browsers, which provides a satisfactory player UI. And allowing that element seems more a config job than a coding one https://xenforo.com/community/resources/post-content-find-replace.1549/ Then if I provide a URL and server that responds with audio/flac content type then we're off to the races for the player side. If GDrive does the server part (idk) then I could live with that.
I think all cloud services pretty much prevent direct access to files to prevent you from using it like some sort of web host or CDN where you can freely embed files offsite. I'm sure there is a cloud service out there that allows this, but I'm not sure.

Maybe you can look into hosting it on a raspberry pi or something like that.

 
I have an Asus router and Merlin firmware and it's got a cloud hosting built in to share files on the Internet. Google and OneDrive gives 15gb per account and you can share links that way also.
Yes, it looks like GDrive is fine so long as we accept that listeners click through to a Google web server to access the player. I would prefer an embedded player like this

 
It looks like FLAC works in an <audio> element in the popular browsers, which provides a satisfactory player UI. And allowing that element seems more a config job than a coding one https://xenforo.com/community/resources/post-content-find-replace.1549/ Then if I provide a URL and server that responds with audio/flac content type then we're off to the races for the player side. If GDrive does the server part (idk) then I could live with that.
Just use html5 like this;

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Home</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <audio controls> <source src="yourmusic.flac" type="audio/flac"> Your browser does not support the audio element. </audio> </body> </html>
 
Just use html5 like this;

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Home</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <audio controls> <source src="yourmusic.flac" type="audio/flac"> Your browser does not support the audio element. </audio> </body> </html>
An HTML document like that hosted elsewhere could go in a suitably sized iframe in an ASR post but the rich text editor must be ready, willing and able to make the iframe in response to some bbcode input from the user. The forum can likely be made to do that with a suitable XenForo plugin, perhaps the one I mentioned above.

But given that a new "embed audio from URL" bbcode tag will be prepared, we can make it a lot more convenient and avoid having to host an HTML document like the one you gave in addition to the audio file. So the iframe isn't needed, we only need the audio element and put the audio resource URL in it (CORS permitting).
 
I think this is the best we will get below. embedding via iframes are possible on these message boards, but I doubt general users will be given that sort of access.
An audio file URL of the GDrive example you gave is https://drive.usercontent.google.com/download?id=1nkuCN9quY4Pmx68sdQIXq81uIr_bkZT3

I checked the response headers in cURL and I think it should work in an audio element. If so, it should be possible to make XenForo convert a share link prepared they way you did into an embedded player.

I've no more time to experiment now.
 
FWIW, I tested audio playback via Google Drive and it does just fine.

Multitone REW analysis:
MT Graph3.png

Music null test via Deltawave:
Screenshot 2024-04-08 215442.png
(The full Deltawave report is attached below)

Signal chain was PC->USB->SMSL PO100->Toslink->Hifime UR23->USB->PC.
 

Attachments

  • GDrive Playback.zip
    2.6 MB · Views: 44
Back
Top Bottom