Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): block win sound #372

Merged
merged 18 commits into from
Feb 6, 2025
Merged

Conversation

MCozhusheck
Copy link
Collaborator

Description

Add sound effect when block is mined.

Motivation and Context

More feedback to the user.

How Has This Been Tested?

Replaced condition to run audio and tested manually.

What process can a PR reviewer use to test or verify this change?

Same as above.

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@stringhandler
Copy link
Contributor

Marking as controversial because of the permissions change

@brianp
Copy link
Collaborator

brianp commented Oct 25, 2024

I want a block win sound. What exactly is the problem with permissions?

@MCozhusheck
Copy link
Collaborator Author

I want a block win sound. What exactly is the problem with permissions?

We need permissions for reading buffered file but I had problem with assign correct scope for just a single file that we needed and I ended up with "scope": ["**"], that works fine.

I tried using something like "$RESOURCE/block_win.mp3" and assets/block_win.mp3 to no use.

@MCozhusheck
Copy link
Collaborator Author

Managed to reduce the read access to just the audio file so now it's much less controversial.

@Misieq01
Copy link
Collaborator

Tested on Ubuntu | MacOS | Windows 11 and works on each one

@brianp
Copy link
Collaborator

brianp commented Feb 3, 2025

I can't currently test this because every time I win I get lose animations.

Once we fix the animation timing, I'll come back to this.

@brianp
Copy link
Collaborator

brianp commented Feb 4, 2025

We need the block win sound to also play on the block win replay.

@brianp
Copy link
Collaborator

brianp commented Feb 5, 2025

Can you also add an event item that tracks when the sound is toggled?

@MCozhusheck
Copy link
Collaborator Author

Added boolean in the BlockchainVisualization for tracking when the audio is playing isPlayingAudio and a setter setIsPlayingAudio.
Also we send telemetry event that looks like this:

{
  "app_id": "hJr@t#FsvG30Mn2QLAS$",
  "cpu_name": "11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz",
  "created_at": {
    "nanos_since_epoch": 597927466,
    "secs_since_epoch": 1738765756
  },
  "event_name": "audio-enabled",
  "event_value": false,
  "gpu_name": "Intel(R) Iris(R) Xe Graphics [0x9a49]",
  "os": "Linux",
  "user_id": "v3,TFKEtEunDgrKrSkVYG54zU6x4tuJ,0.9.2,47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU",
  "version": "0.9.2"
}

@brianp brianp merged commit 413d77a into tari-project:main Feb 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants