brailcom / brailcom/speechd

`GenericMaxChunkLength` causes incomplete multibyte characters

Open
#806 4 comments 0 reactions 0 assignees View on GitHub
bug good first issue help wanted
Dominant language
C
Stars
331
Forks
92
Avg merge
2d 10h
Merged PRs (30d)
9

Description

### Steps to reproduce

Create /etc/speech-dispatcher/modules/test.conf

```
# GenericMaxChunkLength 300
GenericExecuteSynth "echo $DATA >> /tmp/tts.log"

GenericLanguage "en" "en" "utf-8"
GenericLanguage "zh" "zh" "utf-8"

AddVoice "en" "male1" "voice1"
```

Add configuration to /etc/speech-dispatcher/speechd.conf

```
AddModule "test-generic" "sd_generic" "test.conf"
```

Restart speech-dispatcher and use test-generic

```sh
$ sudo killall speech-dispatcher

$ spd-say -o test-generic "ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇"
```

### Obtained behavior

```
$ cat /tmp/tts.log
ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇〇〇〇〇〇〇〇ab〇〇〇�
��〇〇〇〇〇〇
```

Passing incomplete multibyte characters to external commands is likely to not work properly, and subsequent chunks will not even be recognized as UTF-8 strings.

### Expected behavior

Do not break down multibyte characters.

The string should be broken down into chunks of the specified length in characters (not bytes).

### Behavior information

[speech-dispatcher.log](https://github.com/brailcom/speechd/files/10446871/speech-dispatcher.log)

### Distribution

Debian

### Version of Speech-dispatcher

0.11.4

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.