Skip to content

Commit

Permalink
Add SpeechDispatcher symbol level support.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1maker authored and m1maker committed Oct 18, 2024
1 parent c754e46 commit 1c26701
Show file tree
Hide file tree
Showing 34 changed files with 5,119 additions and 5,109 deletions.
94 changes: 47 additions & 47 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
name: CMake Build

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.25.0'

- name: Install packages
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libspeechd-dev
- name: Configure CMake
run: cmake . -B build -DCMAKE_OSX_ARCHITECTURES=x86_64

- name: Build with CMake
run: cmake --build build --config Release



- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-build
path: build


name: CMake Build

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.25.0'

- name: Install packages
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libspeechd-dev
- name: Configure CMake
run: cmake . -B build -DCMAKE_OSX_ARCHITECTURES=x86_64

- name: Build with CMake
run: cmake --build build --config Release



- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-build
path: build


76 changes: 38 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
# Other
.vs/
out/
Release/
*.pyc
*.pyd
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
# Other
.vs/
out/
Release/
*.pyc
*.pyd
92 changes: 46 additions & 46 deletions Bindings/Python/Example.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import time

import sral

def sleep_ms(milliseconds):
time.sleep(milliseconds / 1000.0) # Convert milliseconds to seconds

def main():
text = ""
# Initialize the SRAL library
instance = sral.Sral(32)

instance.register_keyboard_hooks()

# Speak some text
if instance.get_engine_features(0) & 128:
text = input("Enter the text you want to be spoken:\n")
instance.speak(text, False)

# Output text to a Braille display
if instance.get_engine_features(0) & 256:
text = input("Enter the text you want to be shown on braille display:\n")
instance.braille(text)

# Delay example
instance.output("Delay example: Enter any text", False)
instance.delay(5000)
instance.output("Press enter to continue", False)
input() # Wait for user to press enter

instance.stop_speech() # Stops the delay thread

# Speech rate
if instance.get_engine_features(0) & 512:
rate = instance.get_rate()
max_rate = rate + 10
for rate in range(rate, max_rate):
instance.set_rate(rate)
instance.speak(text, False)
sleep_ms(500)

# Uninitialize the SRAL library
instance = None
if __name__ == "__main__":
main() # invoke_main()

import time

import sral

def sleep_ms(milliseconds):
time.sleep(milliseconds / 1000.0) # Convert milliseconds to seconds

def main():
text = ""
# Initialize the SRAL library
instance = sral.Sral(32)

instance.register_keyboard_hooks()

# Speak some text
if instance.get_engine_features(0) & 128:
text = input("Enter the text you want to be spoken:\n")
instance.speak(text, False)

# Output text to a Braille display
if instance.get_engine_features(0) & 256:
text = input("Enter the text you want to be shown on braille display:\n")
instance.braille(text)

# Delay example
instance.output("Delay example: Enter any text", False)
instance.delay(5000)
instance.output("Press enter to continue", False)
input() # Wait for user to press enter

instance.stop_speech() # Stops the delay thread

# Speech rate
if instance.get_engine_features(0) & 512:
rate = instance.get_rate()
max_rate = rate + 10
for rate in range(rate, max_rate):
instance.set_rate(rate)
instance.speak(text, False)
sleep_ms(500)

# Uninitialize the SRAL library
instance = None
if __name__ == "__main__":
main() # invoke_main()
Loading

0 comments on commit 1c26701

Please sign in to comment.