Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

play random sounds after a transaction - #243

Open
C0rby wants to merge 2 commits into
strichliste:masterfrom
C0rby:master
Open

play random sounds after a transaction#243
C0rby wants to merge 2 commits into
strichliste:masterfrom
C0rby:master

Conversation

@C0rby

@C0rby C0rby commented Aug 26, 2022

Copy link
Copy Markdown

Context

We @Nerdbergev wanted the strichliste to play different sounds after purchasing an item. This is the result of my quick attempt at implementing this feature. I'm not that advanced at web development though so feel free to tell me if I need to change anything.

Feature

The default is still only the 'ka-ching' sound. To add more sounds you need
to place your sound files into the 'sounds' folder next to the ka-ching.wav file and then add the
filename to the sounds in the strichliste.yaml.
It's now also possible to configure different sounds for dispenses and deposits.

This PR requires this backend change first: strichliste/strichliste-backend#76

The default is still only the 'ka-ching' sound. To add more sounds you need
to place your sound files next to the `ka-ching.wav` file and then add the
filename to the sounds in the `sounds-config.json` file.
E.g. (sounds-config.json):
```json
{
    "sounds":["ka-ching.wav", "mario-coin.wav"]
}
```
@C0rby C0rby changed the title implement random sounds after a transaction play random sounds after a transaction Aug 26, 2022
@schinken

Copy link
Copy Markdown
Contributor

Hi! Thanks for your PR.. but I think this is not the right spot for it. The backend has a settings-endpoint:

https://github.com/strichliste/strichliste-backend/blob/master/src/Controller/Api/SettingsController.php

Which serves these settings to the frontend:
https://github.com/strichliste/strichliste-backend/blob/master/config/strichliste.yaml

In my opinion there should be something like a sounds folder or sth. like that inside public/:
https://github.com/strichliste/strichliste-backend/tree/master/public

And the files should be configured inside the strichliste.yml.

Maybe it's clever to add a config parameters sounds to deposit and dispense where you can configure the sounds:
https://github.com/strichliste/strichliste-backend/blob/master/config/strichliste.yaml#L51

So you can even configure different ones for deposit and dispense?

@C0rby

C0rby commented Aug 27, 2022

Copy link
Copy Markdown
Author

Good points! I'll implement the feedback. 👍

The sounds can now be configured via the backend config and are loaded
from the 'sounds' folder. It's also possible to configure different
sounds for dispense and deposit.
@C0rby

C0rby commented Sep 1, 2022

Copy link
Copy Markdown
Author

I've implemented the suggestions. I hope this code is ok. I'm not that proficient in React.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants