Author Topic: VerBeeliser Track Information Announcer Plugin  (Read 5963 times)

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Latest version is available here Link.

Minimum version required - 3.6.9143 P

It will not work on previous versions.

Does not work with WASAPI Exclusive mode.

This plugin allows you to configure any Metadata tag to be announced before or after a track plays using any installed voice in windows.

To open the settings go to Hamburger Menu->Edit Preferences->Plugins->verbeeliser->Configure



Any tag in the list on the left can be dragged to the right hand list. These can be dragged around to whatever order you want. You have to click on the actual text in the right hand list not just the line its in to drag them around.

To remove an item from the right hand list just drag it outside box. You will lose any Prefix/suffix/No Value you had set for that item. Note: it will be deleted as soon as you drag it outside the box, it doesn't wait for you to release the mouse button. It won't let you remove the last item.

The voice dropdown is populated by the installed voices in windows. You can add more voices by going to the following section in Windows - Settings->Time & Language->Speech->Manage Voices

End of Track specifies if the announcement happens at the end of the track

Volume Offset - The announcement uses the current volume setting in Musicbee. This value will increase the volume used for the announcement by the specified amount

Double clicking an item in the right hand list will open another form (again you have to double click the text,  not just the line it's in).


Prefix - This will be spoken before the tag value
Suffix - This will be spoken after the tag value
No Value - This will be spoken if the tag value is empty.

In the example you can see I have it setup the Rating Tag. If the track playing has a 2.5 star rating it will say "Rating 2.5 stars". If the rating is empty it will say "Rating Zero Stars"

if all these settings are left blank it would just say "2.5" or nothing at all if it's empty.

If you want to add a small delay just add 3 full stops "..."

If the Prefix was set to "Rating...", when the announcement happens there will be a small pause between it saying "Rating" and "2.5". I've used quotes here to stipulate the values, you don't need to use quotation marks when entering the values.

I haven't done extensive testing so your mileage may vary....

edit: I new I would forget something.... You can also setup a hot key so it will announce the current playing song.
Hamburger Menu->Edit Preferences->Hotkeys->VerBeeliser Playing Track.

When the hot key is pressed it will pause the song, announce the information and then resume playing it.
Last Edit: January 21, 2025, 04:16:40 AM by BoringName

aktor

  • Sr. Member
  • ****
  • Posts: 336
It works only if end of the track is enabled. Plus there is a scaling problem as voice selector is hidden behind tags rolldown field.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
It works only if end of the track is enabled. Plus there is a scaling problem as voice selector is hidden behind tags rolldown field.

Can you please confirm you are using version 3.6.9143 and what font you have set in Musicbee. I have the forms set to a fixed font size so they shouldn't be scaling.

Can you confirm if "end of track" unticked doesn't work in the following scenarios.
- Nothing playing in musicbee and right clicking a track and selecting Play Now.
- letting a song play through until it switches to another track.

Note - if the tags you have selected are empty on the track you are playing, nothing will be spoken unless you have configured the prefix, suffix etc...

edit: I forgot an important bit of info. This will not work with WASAPI Exclusive mode.

aktor

  • Sr. Member
  • ****
  • Posts: 336
I updated MB and now it works. I had  3.6.9133 version. Voice selector still hidden. OK and cancel partly visible.
An option for only hotkey functionality. Every song is too much.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I updated MB and now it works. I had  3.6.9133 version.

Do you have any suggestions on how I could have made the version requirement any clearer? It's literally the first thing under the download link listed in bold.....

Voice selector still hidden. OK and cancel partly visible.

You didn't list what font you are using.

An option for only hotkey functionality. Every song is too much.

I'll put an disable option into the next version.

aktor

  • Sr. Member
  • ****
  • Posts: 336
SegoeUI 9.75 pt
An option that would allow voice speaking over the song audio. Now it wait till the announcement is over.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
SegoeUI 9.75 pt
An option that would allow voice speaking over the song audio. Now it wait till the announcement is over.

I can't reproduce the layout issue. Are you running anything that scales your windows UI? Could you provide a screenshot.

I didn't think users would want to miss out on any of the track while the announcements were being made, shows what I know....


BoringName

  • Sr. Member
  • ****
  • Posts: 916
yes windows are in 125% scale.

Is that just through windows display settings or a third party app?

If I change my scale and layout to 125% in windows display settings, everything still displays correctly. It's just larger....

I'm using windows 10, maybe it's a windows 11 issue?

Confirmed it is a windows 11 issue to do with DPI settings. I'll see what I can do.
Last Edit: January 13, 2025, 11:31:17 PM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
New version - mb_VerBeeliser_1.1.zip

Changes
- Hopefully fixed layout issues with windows 11 at higher DPI settings (not that confident I have). I have no way to test it.
- Moved the process to a separate thread so it runs a bit smoother and doesn't cause issues with Musicbee's player state.
- New Option "Do not pause track", when enabled VerBeeliser will speak over the stop of the track.
- New Option "Hotkey Only", When enabled VerBeeliser will only speak when the hotkey is used.
- New Option "Track Volume Offset", The track volume will be lowered by this amount when VerBeeliser speaks.

Known issue when "End of Track" is ticked.
Right clicking a track and selecting Play Now triggers a PlayerStateChanged notification for PlayState.Stopped followed by a second notification for PlayState.Playing. This notification also triggers for PlayState.Stopped when Musicbee has finished playing a list of tracks. I use this to announce the last track played as the usual notification I use (TrackChanging) doesn't trigger at the end of the last track.

I couldn't see a way to determine if the user clicked "Play Now" or a list of tracks just finished playing. The best I could come up with was checking the track supplied by the notification against the last track in the Now Playing List and if it matched, announce the details. This means under certain circumstances selecting "Play Now" on a track will result in VerBeeliser announcing at the start of the track even if you have "end of track" ticked. The main circumstance being that you select "Play Now" on a track that is currently the last track in the now playing list. Another would be selecting Play Now on a track while the last track in the Now Playing List is playing.

There might be a better way to do it but for now that's how it works. After the initial song it will announce properly as Musicbee transitions to subsequent songs.

It also won't announce the same track two times in a row which is a measure to stop it constantly announcing from the user pushing stop/pause etc... So if you are playing around testing and it doesn't trigger just make sure that's not the reason before reporting a problem. This also means it if you have the same song listed 5 times in the now playing list, it will only announce for the first track if they are listed consecutively with no other tracks inbetween.

I intended to make the Track Volume Offset a negative range but came across a bug I couldn't solve.

For anyone else that might come across this or know a solution. I had the 2 numericUpDown elements set with different min/max values.
Volume offset: 0 min and 100 max.
Track volume offset:  -100 min and 0 max.

When configured this way, any attempt to set a value to either of these when loading the config page resulted in an out of range exception even when the value was in the valid range. It didn't matter which one I chose to set or what value I used. It's like it was checking the value against the min/max thresholds of both controls. Setting the value to zero was the only way it worked, I assume because that's the only overlapping value between their thresholds. Once the page loaded I could use the controls to set values within their min/max ranges but once I saved and tried to re-open the config page the error occurred again.

I tried cleaning and rebuilding in Visual studio, deleting both controls and adding them again. Setting the min/max values at runtime. The only solution was setting both their min/max values to 0/100.

aktor

  • Sr. Member
  • ****
  • Posts: 336
That scaling bug it is still there.
Check boxes should be before text.
Otherwise good job. Thank you.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
New Version - mb_VerBeeliser_1.1.1.zip

Changes
- Changed to DPI scaling instead of font scaling to try and solve the windows 11 layout issue.
- layout changes on the config panel

Let me know how that goes. I have a few more options to try but I'm trying the easier ones first.

aktor

  • Sr. Member
  • ****
  • Posts: 336
Scaling: Improvement. OK and cancel visible. But voice selector still hidden.
Prefix/ suffix: If a key is used as hotkey the letter doesn't type in.
Voice Option: Plugin uses the system audio but if someone uses USB DAC ( like me) or wifi streamer an option to select audio output would be useful.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Scaling: Improvement. OK and cancel visible. But voice selector still hidden.

Progress. Is the voice selector invisible or has it just been covered up by other elements? An image would be good.

Prefix/ suffix: If a key is used as hotkey the letter doesn't type in.

I'm not sure what you mean. The code is exactly the same whether triggered by a hotkey or track transition.

Voice Option: Plugin uses the system audio but if someone uses USB DAC ( like me) or wifi streamer an option to select audio output would be useful.

I had a bunch of code for selecting different audio devices when I made VUMeter but I think I got rid of it.... I'll check my backups. It shouldn't be too hard to sort out.