Skip to content

Commit

Permalink
add support for auto-generating audio languages
Browse files Browse the repository at this point in the history
  • Loading branch information
hall committed Jan 15, 2023
1 parent b1455a3 commit e275394
Show file tree
Hide file tree
Showing 338 changed files with 260 additions and 15,600 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]


## [0.1.1] - 2023-01-15

This release welcomes a handful of common languages.
See the `README.md` file for details.

### Added

- support for different notification languages

## [0.1.0] - 2023-01-09

This release pulls in changes from [OpenPineBuds](https://github.com/pine64/OpenPineBuds).
Expand Down
18 changes: 17 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ make -j

The compiled firmware will be at `./out/firmware.bin`.

## language

Audio notification sounds are generated with [translate-shell](https://github.com/soimort/translate-shell) by running

```sh
nix run '.#tts' <lang>
```

> **NOTE**: for reproducibility, these files should be committed to the repo (doing so will automatically include them in the next release)
The default language is English but can be changed by passing a [2-digit language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) to `make`

```sh
make -j LANG=fr
```

## flash

Flash both earbuds:
Expand All @@ -34,5 +50,5 @@ View logs over the serial port with

## release

Create a new release by moving the "Unreleased" section in [`CHANGELOG.md`](./CHANGELOG.md) to a new version.
Move the "Unreleased" section in [`CHANGELOG.md`](./CHANGELOG.md) to a new version.
Once pushed the [`main.yml`](./.github/workflows/main.yml) workflow will create a new release.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ifeq ($(MAKECMDGOALS),help)
HELP_TARGET := 1
endif

export LANG := en

ifneq ($(HELP_TARGET),1)
# We are using a recursive build, so we need to do a little thinking
# to get the ordering right.
Expand Down Expand Up @@ -265,7 +267,7 @@ BUILD_USERNAME := $(subst $(space),-,$(strip $(BUILD_USERNAME)))
# Default kernel image to build when no specific target is given.
# IMAGE_FILE may be overruled on the command line or
# set in the environment
IMAGE_FILE ?= firmware.elf
IMAGE_FILE ?= firmware-$(LANG).elf

ifneq ($(filter .map .bin .hex .lst,$(suffix $(IMAGE_FILE))),)
$(error Invalid IMAGE_FILE (conflicted suffix): $(IMAGE_FILE))
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@ Flash both earbuds with [`bestool`](https://github.com/Ralim/bestool):

> **NOTE**: if you have [nix](https://nixos.org/download.html) installed, you can use `nix run 'github:hall/little-buddy#bestool'` instead of building and installing it yourself
## languages

The following languages of audio alerts are currently supported:

| name | translation | code |
| --------- | :---------- | :--- |
| عربى | Arabic | ar |
| বাংলা | Bengali | bn |
| Deutsche | German | de |
| English | English | en |
| Español | Spanish | es |
| Français | French | fr |
| हिंदी | Hindi | hi |
| 日本 | Japanese | ja |
| Português | Portuguese | pl |
| русский | Russian | ru |
| 中国人 | Chinese | zh |

As they are autogenerated, new languages are both easy to add and likely to have inconsistencies.
Feel free to open an issue in either case.
## attribution

Thus far, I've written almost none of this.
Expand Down
132 changes: 0 additions & 132 deletions config/res/SOUND_MUTE.txt

This file was deleted.

Loading

0 comments on commit e275394

Please sign in to comment.