Skip to content

Add speech synthesis support - #2206

Merged
vitaut merged 2 commits into
masterfrom
os
Apr 1, 2021
Merged

vitaut merged 2 commits into
masterfrom
os

Conversation

@vitaut

@vitaut vitaut commented Apr 1, 2021

Copy link
Copy Markdown
Contributor

Add speech synthesis support to {fmt}.

For example:

#include <fmt/os.h>

int main() {
  fmt::say(
    R"SHANTY(
    There [[emph +]] once was a pen that [[emph +]] put to [[emph +]] paper,
    It [[emph -]] was [[emph +]] gonna be written [[emph +]] sooner or later,
    Ctrl-S went down, the proposal sent out,
    Vote [[emph +]] down my committee vote [[emph +]] down.

    [[emph +]] Soon, may the Unicode come,
    So [[emph +]] we can write aleph and [[emph +]] xĭ and [[emph +]] từng,
    One day when '23 is done,
    We'll take our bom and go.)SHANTY");
}

Output:

say3.mov

@vitaut
vitaut force-pushed the os branch 3 times, most recently from 660c3e5 to 5900df9 Compare April 1, 2021 15:55
@vitaut
vitaut merged commit 0d6b70d into master Apr 1, 2021
@vitaut
vitaut deleted the os branch April 1, 2021 17:09
@tigerw

tigerw commented Apr 11, 2021

Copy link
Copy Markdown

The best kind of feature creep. 3D text render output when

@vitaut

vitaut commented Apr 12, 2021

Copy link
Copy Markdown
Contributor Author

3D text render output when

PRs are welcome (not).

@rcombs

rcombs commented Jul 20, 2021

Copy link
Copy Markdown

In all seriousness, I don't think this is a great idea to have in the library as-is, since it might not be obvious to users that this isn't safe to pass arbitrary input to, nor that it's highly non-portable (say only exists on macOS).

It'd be safer to at least use FILE* f = popen("say", "w"); and fmt::print(f, format_str, args…);.

@vitaut

vitaut commented Nov 16, 2025

Copy link
Copy Markdown
Contributor Author

The function has been removed so that it is not accidentally used in an unsafe way. It was broken with C++20 and more recently with fmt 12 anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants