Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Different sounds for certain events #100

Open
Zettt opened this issue Jun 5, 2020 · 2 comments
Open

Different sounds for certain events #100

Zettt opened this issue Jun 5, 2020 · 2 comments

Comments

@Zettt
Copy link

Zettt commented Jun 5, 2020

I'd like to request a feature. It would be great if users could change the notifications for events like liquidations, and/or set different sounds for the threshold trade volumes.

I think adding this to the threshold menu would make most sense from a UI perspective, but it's getting a little crowded there. So maybe expand the audio options in the menu?

@Tucsky
Copy link
Owner

Tucsky commented Jun 5, 2020

How do you want to set the alternative song, says you want to change it for trades above a specific threshold, play a song. How you do see that? Upload a wav to the app ? Or edit a js like code which define what beep to play in what order/intensity etc
< 100k
this.play(659.26, Math.sqrt(factor) / 10, 0.1 + Math.sqrt(factor) / 10)
> 100k
[659.26, 830.6].forEach((f, i) => setTimeout(() => this.play(f, 0.05 + Math.sqrt(factor) / 10, 0.1 + factor * 0.1), i * 80))
> 1M
[659.26, 830.6, 987.76, 1318.52].forEach((f, i) => setTimeout(() => this.play(f, 0.05 + Math.sqrt(factor) / 25, 0.1 + factor * 0.1), i * 80)

@Zettt
Copy link
Author

Zettt commented Jun 6, 2020

Interesting question. Never thought about it. The obvious problem is that sounds can't be as easily inserted as GIF's. There's no Giphy-like API for sounds, which makes it very hard to automate.

I see a couple of options:

  • Users specify a direct URL from where to play the file. As far as I remember the HTML5 audio tag plays most sound files in almost any browser. MP3 is probably best supported.
  • Users drag'n'drop their audio files onto the browser window.

In either case, the question is whether this causes a lot of issues for the app? It is probably best to use HTML5 local storage to store the files, then they are easier to play. The app would only have to iterate an array of locally stored sounds, and display a menu. Does that make sense?

Here's a (horrific) mockup. I hope it gets a rough idea across. Not a huge fan of "when in doubt, just make it a submenu" solutions though.

Untitled

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants