Skip to content

Commit

Permalink
v1.2.0 with mr annas
Browse files Browse the repository at this point in the history
Version 1.2.0
added multiple sound packages
added new keyboard shortcuts
added a settings page
added a arabic language
update the redmi file
Contributed by mesteranas
This is the version I intend to publish it on nvde addon store for the first time.
  • Loading branch information
ahmedthebest31 committed Sep 6, 2023
1 parent 2b173ff commit 07d2789
Show file tree
Hide file tree
Showing 113 changed files with 248 additions and 91 deletions.
35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
# navsounds

# nav Sounds
This is an NVDA screen reader add-on that provides navigation sounds based on different roles when interacting with the screen reader.

## About


This add-on is inspired by the abandoned "objsounds" add-on created by Tyler Spivey. Since that add-on hasn't been updated for a long time, I decided to create this add-on to continue providing similar functionality while keeping up with the changes in the NVDA screen reader.


## Features

- Provides navigation sounds based on different roles.
- Toggle the navigation sounds on and off using a keyboard gesture.
- Designed to work with NVDA version 2019.3 and later.
- Toggle Functionality: Easily switch between enabling and disabling object sounds and toggling object type reading with a simple keyboard gesture.
- Customization: Access a settings page where you can choose from various navigation sound packages and configure additional options.
- Expandable: includes a selection of sound packages, and you can even create and add your custom packages.

- Compmpatibility: Designed to seamlessly work with modern NVDA versions, starting from 2019.3 and later.


## Installation
For NVDA Installed Versions:
1. Download the latest release from the [Releases](https://github.com/ahmedthebest31/navsounds/releases/) section.
2. Double-click the downloaded add-on file and confirm the installation by clicking "OK."
3. NVDA will automatically restart, and you're ready to use NavigationSounds.


1. Download the latest release from the [Releases ](https://github.com/ahmedthebest31/navsounds/releases) section.
2. Open the NVDA screen reader.
3. Navigate to the NVDA menu -> Tools -> Manage add-ons.
For NVDA Portable Installation:

1. Download the latest release from the [Releases](https://github.com/ahmedthebest31/navsounds/releases) section.
2. Open your NVDA screen reader.
3. Navigate to the NVDA menu: Tools -> Manage add-ons.
4. Click the "Install" button and select the downloaded add-on file.
5. Restart NVDA.
5. Restart NVDA to activate NavigationSounds.


## Usage

- The navigation sounds will play based on the roles of objects as you interact with NVDA.
- To toggle the navigation sounds on or off, use the keyboard gesture: NVDA+Shift+Delete.
- use the keybord shortcut (NVDA+alt+n) Pressing it once toggles between on and off object sounds, and Pressing twice it toggles between reading and disabling object types
- You can customize the keyboard shortcut as you prefer
open nvda menue Preferences subMenu / Input gestures
navigation sounds

## Contributing

Contributions to this project are welcome! If you find a bug, have an idea for an improvement, or want to contribute in any other way, please feel free to open an issue or submit a pull request.

Special thanks to [mesteranas](https://github.com/mesteranas/) for his wonderful Contributions in developing this add-on with me.
99 changes: 99 additions & 0 deletions navsounds/globalPlugins/NavigationSounds/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# -*- coding: UTF-8 -*-
import globalPluginHandler
from winsound import PlaySound
import controlTypes, ui, os, speech, NVDAObjects
import config
from scriptHandler import script, getLastScriptRepeatCount
from gui import SettingsPanel, NVDASettingsDialog, guiHelper
import addonHandler
addonHandler.initTranslation()
import wx


roleSECTION = "NavigationSounds"
confspec = {
"sayRoles": "boolean(default=false)",
"soundType": "string(default=sound1)",
"rolesSounds": "boolean(default=true)"}
config.conf.spec[roleSECTION] = confspec
rolesSounds= config.conf[roleSECTION]["rolesSounds"]
sayRoles= config.conf[roleSECTION]["sayRoles"]
def loc():
return os.path.join(os.path.abspath(os.path.dirname(__file__)), "effects",config.conf[roleSECTION]["soundType"])
#Add all the roles, looking for name.wav.
def sounds():
sounds1 = {}
for role in [x for x in dir(controlTypes) if x.startswith('ROLE_')]:
r = os.path.join(loc(), role[5:].lower()+".wav")
sounds1[getattr(controlTypes, role)] = r
return sounds1

def getSpeechTextForProperties2(reason=NVDAObjects.controlTypes.OutputReason, *args, **kwargs):
role = kwargs.get('role', None)
if 'role' in kwargs and role in sounds() and os.path.exists(sounds()[role]) and sayRoles ==False:
del kwargs['role']
return old(reason, *args, **kwargs)

def play(role):
"""plays sound for role."""
f = sounds()[role]
if os.path.exists(f) and rolesSounds==True:
PlaySound(f, 1)

class GlobalPlugin(globalPluginHandler.GlobalPlugin):
scriptCategory= _("navigation sounds")
def __init__(self, *args, **kwargs):
globalPluginHandler.GlobalPlugin.__init__(self, *args, **kwargs)
NVDASettingsDialog.categoryClasses.append(NavSettingsPanel)
global old
old = speech.speech.getPropertiesSpeech

def event_gainFocus(self, obj, nextHandler):
if rolesSounds == True:
speech.speech.getPropertiesSpeech = getSpeechTextForProperties2
play(obj.role)
nextHandler()

@script(gesture="kb:NVDA+alt+n")
def script_toggle(self, gesture):
global rolesSounds, sayRoles
isSameScript = getLastScriptRepeatCount()
if isSameScript == 0:
rolesSounds = not rolesSounds
if rolesSounds==False:
ui.message(_("Disable navigation sounds"))
else:
ui.message(_("Enable navigation sounds"))
elif isSameScript ==1:
sayRoles = not sayRoles
if sayRoles ==False:
ui.message(_("Disable sayRoles"))
else:
ui.message(_("Enable sayRoles"))
config.conf[roleSECTION]["sayRoles"] = sayRoles
config.conf[roleSECTION]["rolesSounds"] = rolesSounds
script_toggle.__doc__= _("Pressing it once toggles between on and off object sounds, and Pressing twice it toggles between reading and disabling object types.")
def terminate(self):
NVDASettingsDialog.categoryClasses.remove(NavSettingsPanel)

class NavSettingsPanel(SettingsPanel):
title = _("navigation sounds")
def makeSettings(self, settingsSizer):
sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
self.tlable = sHelper.addItem(wx.StaticText(self, label=_("select sound"), name="ts"))
self.sou= sHelper.addItem(wx.Choice(self, name="ts"))
self.sou.Set(os.listdir(os.path.join(os.path.abspath(os.path.dirname(__file__)), "effects")))
self.sou.SetStringSelection(config.conf[roleSECTION]["soundType"])
self.nas=sHelper.addItem(wx.CheckBox(self,label=_("say roles")))
self.nas.SetValue(config.conf[roleSECTION]["sayRoles"])
self.nab=sHelper.addItem(wx.CheckBox(self,label=_("navigation sounds")))
self.nab.SetValue(config.conf[roleSECTION]["rolesSounds"])
def postInit(self):
self.sou.SetFocus()
def onSave(self):
global sayRoles,rolesSounds
config.conf[roleSECTION]["soundType"]=self.sou.GetStringSelection()
config.conf[roleSECTION]["sayRoles"]=self.nas.GetValue()
sayRoles=config.conf[roleSECTION]["sayRoles"]
config.conf[roleSECTION]["rolesSounds"]=self.nab.GetValue()
rolesSounds=config.conf[roleSECTION]["rolesSounds"]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
76 changes: 0 additions & 76 deletions navsounds/globalPlugins/navsounds/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion navsounds/globalPlugins/navsounds/objdata/__init__.py

This file was deleted.

Binary file removed navsounds/globalPlugins/navsounds/objdata/__init__.pyo
Binary file not shown.
59 changes: 59 additions & 0 deletions navsounds/locale/ar/LC_MESSAGES/messages.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2023-09-02 13:56+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=cp1252\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"


#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:49
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:85
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:94
msgid "navigation sounds"
msgstr ""

#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:69
msgid "Disable navigation sounds"
msgstr ""

#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:71
msgid "Enable navigation sounds"
msgstr ""

#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:75
msgid "Disable sayRoles"
msgstr ""

#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:77
msgid "Enable sayRoles"
msgstr ""

#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:80
msgid "Pressing it once toggles between on and off object sounds, and Pressing twice it toggles between reading and disabling object types."
msgstr ""

#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:88
msgid "select sound"
msgstr ""

#:
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:92
msgid "say roles"
msgstr ""

Binary file added navsounds/locale/ar/LC_MESSAGES/nvda.mo
Binary file not shown.
57 changes: 57 additions & 0 deletions navsounds/locale/ar/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: navigation sounds 1.0\n"
"POT-Creation-Date: 2023-09-02 13:56+0300\n"
"PO-Revision-Date: 2023-09-02 13:58+0300\n"
"Last-Translator: \n"
"Language-Team: mesteranas\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : "
"n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.3.2\n"

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:49
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:85
#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:94
msgid "navigation sounds"
msgstr "أصوات التنقل"

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:69
msgid "Disable navigation sounds"
msgstr "تعطيل أصوات التنقل"

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:71
msgid "Enable navigation sounds"
msgstr "تفعيل أصوات التنقل"

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:75
msgid "Disable sayRoles"
msgstr "تعطيل نطق أنواع ألكائنات"

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:77
msgid "Enable sayRoles"
msgstr "تفعيل نطق أنواع ألكائنات"

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:80
msgid ""
"Pressing it once toggles between on and off object sounds, and Pressing "
"twice it toggles between reading and disabling object types."
msgstr ""
"يؤدي الضغط عليه مرة واحدة إلى التبديل بين تشغيل وإيقاف أصوات الكائنات، "
"والضغط عليه مرتين يؤدي إلى التبديل بين قراءة أنواع الكائنات وتعطيلها."

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:88
msgid "select sound"
msgstr "اختيار الصوت"

#: C:\Users\Mesteranas1\AppData\Roaming\nvda\addons\NavigationSounds\globalPlugins\NavigationSounds\__init__.py:92
msgid "say roles"
msgstr "نطق أنواع الكائنات"
2 changes: 2 additions & 0 deletions navsounds/locale/ar/manifest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
summary = "أصوات التنقل"
description = """تشغيل أصوات عند الحركة"""
10 changes: 5 additions & 5 deletions navsounds/manifest.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name = navsounds
name = navSounds
summary = "Navigation sound effects"
description = "provides navigation sounds based on different roles when interacting with the screen reader" elements."
author = "AhmedTheBest"
description = "provides navigation sounds based on different roles when interacting with the NVDA"
author = "AhmedTheBest with a Contributions of mesteranas"
url = "https://github.com/ahmedthebest31/navsounds/"
version = 1.0.0
version = 1.2.0
docFileName = None
minimumNVDAVersion = 2019.3.0
lastTestedNVDAVersion = 2030.1.0
lastTestedNVDAVersion = 2023.1.0
updateChannel = None
Binary file added navsounds/t.nvda-addon
Binary file not shown.

0 comments on commit 07d2789

Please sign in to comment.