Live data from Hacker News

I Built My Own Audio Player

nexo.sh

31–40 of 209 posts

Re: I Built My Own Audio Player

#33
post #19
post #10

Earlier quoted context omitted.

They specifically ditched react-native because of their requirements regarding file system traversal, so this is definitely not something that could have been done in-browser.

Traversing local directories is supported via the File System Access API in browsers these days: https://stackoverflow.com/questions/64283711 It works nicely in Chrome on the desktop and on Android. Not sure how the situation is on iOS.

But unfortunately not on Safari respectively the iOS webview, which would have been mandatory for the author to use. If I am wrong, I‘d gladly take a solution. I think this is one of the main problems for PWAs: No good , platform-independent way to access the local file system. As in „pick once, access forever“.

Edit: https://caniuse.com/native-filesystem-api

Edit2: Just a few posts down: https://webamp.org/

Re: I Built My Own Audio Player

#34
post #6

I wonder if one could build this in HTML, so there is no need to install anything. On both iOS and Android, HTML can play videos and mp3s while the screen is turned off. So maybe it is possible?

It's actually surprisingly hard to get iOS Safari to keep playing audio with the screen off. When I made https://ambiph.one I ended up having to route everything through a MediaStreamAudioDestinationNode to trick Safari into thinking it's a livestream, which is apparently the only type of audio allowed to play in the background Minimal demo here if it's helpful for anyone: https://codepen.io/matteason/pen/VYwdzVV

Hey Matt! I've been a fan of Ambiphone for a while and I see your comments on HN surprisingly often. I've been trying to build a different web audio player with inspiration taken from yours. I haven't figured out the screen off audio thing, so thank you so much for sharing this demo!!!

Re: I Built My Own Audio Player

#35

It's interesting that most/all of the available tools for playing digital music, a well-known and very popular activity... suck. Do we think that's enshittification or product managers misunderstanding the market? In a normal universe one might otherwise expect it to be saturated with options.

Yeah I think a sibling has it right: DRM factors into this, and TPTB do not want another Winamp or VLC that gives freedom to users to play what we want.

The situation for me on Android would be hilarious if it weren't so saddening. Since I purchased a KitKat tablet in 2015, I've more or less stuck to the "Android Files" app to play music files. Yes, that has been the best solution: no app install required, bare bones, no feature demands from me. In fact, rather than making playlists, I would just copy out tracks to a new folder and play them in there. Want to repeat one? Make five copies of it!

On Chromebook I'm using the builtin app, Gallery. It's utterly barebones as well. All I want to do is listen to a track.

This has continued even to the present day, but you know what? Our days are numbered, because apps are staking out moats in terms of file types they will handle. They're looking to reduce generic handling of multiple file types.

I've been trying to conform to this "new normal" by using YouTube Music. With my Premium subscriptions I should be able to download any streamable track, and also listen to files on-device. This is working out poorly. The on-device management is abysmal and makes you want to die. The downloading feature just sort of... fills up my storage, and I don't really even use it. I still fall back on Android Files because Music is such a horrible app, except when I'm using it to stream.

Re: I Built My Own Audio Player

#36
post #24

Earlier quoted context omitted.

The enshitification was completed when they convinced us to no longer want to own our own copies of music but to perpetually rent access to their content.

The latest Iteration I discovered 2 days ago, a audio service(via Amazon), where you have limited time for listening. So I get to listen to that new audiobook, but see my 10 h contingent decrease every second I listen. Creates a new vibe for me.

Libraries had the same count down, but it just wasn't in your face. If you returned a book after the agreed time, they charged you late fees. These guys just cut off access to it. They should have a late fee equivalent where you can extend the time without having to pay the full rental rate again.

Re: I Built My Own Audio Player

#37
Managing local music with Music.app and syncing with Finder iPhone sync still works good for me, but Music.app does seem unmaintained for a couple years now with some annoying bugs since the terrible Big Sur rewrite. Despite the flaws this combination is still the best music library management + mobile sync solution I've seen (plz recommend!), but I feel eventually will have to write a system myself since the software is not maintained and not cross platform.

Re: I Built My Own Audio Player

#38
post #6

I wonder if one could build this in HTML, so there is no need to install anything. On both iOS and Android, HTML can play videos and mp3s while the screen is turned off. So maybe it is possible?

It's actually surprisingly hard to get iOS Safari to keep playing audio with the screen off. When I made https://ambiph.one I ended up having to route everything through a MediaStreamAudioDestinationNode to trick Safari into thinking it's a livestream, which is apparently the only type of audio allowed to play in the background Minimal demo here if it's helpful for anyone: https://codepen.io/matteason/pen/VYwdzVV

The solution I found after approximately two months of struggling with this problem: you have to generate an audio file that is a few seconds of silence, play it on a loop, and play it at the same time as the actual audio file you want to play (via separate audio elements, or an AudioContext). Specifically I believe you need to make sure the silence is “playing” at track boundaries for the real audio, so there is never a single moment where your webapp stops playing audio.

Re: I Built My Own Audio Player

#40
For music on iOS I can't recommend foobar2000 [1] enough - and I tested ALL of the alternatives. You can import ANY folder (probably what OP is looking for) or use your "iPod Library". [2]

Personally, I sync my music via Synctrain (a Syncthing client). [3]

  [1]: https://apps.apple.com/us/app/foobar2000/id1072807669  
  [2]: https://imgur.com/a/7GVxB2y  
  [3]: https://apps.apple.com/us/app/synctrain/id6553985316
Post reply on HN