English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 December 2023, 14:27   #1
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 385
Has anyone ever reverse engineered narrator.device?

Hi all

I was wondering if anyone has ever done (or considered trying to) reverse engineer Workbench 1.3's narrator.device to know exactly how it works and perhaps extend it do do some things such as output to file instead of just outputting straight to audio, or even porting it to modern platforms?

Also, who actually owns it anymore? It was taken out of later workbenches due to some ownership issue was it not? Is it now public domain?
Nightfox is offline  
Old 26 December 2023, 16:38   #2
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
Hi,

Speaking from the point of AmigaOS development, I can tell you that we still have the framework (translator.library) that ThoR kept lubricatring about three/four years ago.

The narrator.device is propietary software. Its makers are still around developing voice synthetizing applications on modern platforms.

I contacted them (I was not the only one) regarding this old code we have that we could still reuse to build narrator.device, but unfortunately they only wanted to do business, and that means $$$ we do not have.

Someone could reverse engineer the code cleanly and slap a MIT license on it and set it free, and we might be able to pick it up and reuse it for a next iteration of AmigaOS. No promises, but certainly a possibility.
gulliver is offline  
Old 26 December 2023, 17:05   #3
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,196
you mean that one ?

Code:
	TTL	'NARRATOR.ASM'


*************************************************************************	
*                                                                    	*
*   Copyright 1990, 1991 Joseph Katz/Mark Barton.  All rights reserved.	*
*   No part of this program may be reproduced, transmitted, or stored   *
*   in any language or computer system, in any form, whatsoever,	*
*   without the prior written permission of the authors.   		*
*   									*
*   Modification History                                               	*
*   									*
*	3/4/91	JK --	Added new subroutine FormSentence to break the	*
*			input into sentences.  Less pause before	*
*			speaking and smaller buffers need be allocated.	*
*************************************************************************
jotd is offline  
Old 26 December 2023, 17:10   #4
Zack
Registered User
 
Zack's Avatar
 
Join Date: Feb 2004
Location: Valby, Denmark
Age: 48
Posts: 90
Related, and could be useful?

A narrator.device emulator has just been released on Github.
Zack is offline  
Old 26 December 2023, 17:35   #5
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by jotd View Post
you mean that one ?

Code:
    TTL    'NARRATOR.ASM'


*************************************************************************    
*                                                                        *
*   Copyright 1990, 1991 Joseph Katz/Mark Barton.  All rights reserved.    *
*   No part of this program may be reproduced, transmitted, or stored   *
*   in any language or computer system, in any form, whatsoever,    *
*   without the prior written permission of the authors.           *
*                                       *
*   Modification History                                                   *
*                                       *
*    3/4/91    JK --    Added new subroutine FormSentence to break the    *
*            input into sentences.  Less pause before    *
*            speaking and smaller buffers need be allocated.    *
*************************************************************************

That's not exactly reverse engineered though.
StingRay is offline  
Old 26 December 2023, 18:25   #6
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
That is not clean reverse engineering!!!
gulliver is offline  
Old 26 December 2023, 18:27   #7
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,196
Quote:
Originally Posted by Zack View Post
Related, and could be useful?

A narrator.device emulator has just been released on Github.

nice but it requires musashi (68000 emulator) and the original devices... not exactly open source

Quote:
Similar to vamos (Virtual AmigaOS runtime), this is a tool that will run the code from the narrator.device and translator.library. The actual code is emulated using the Musashi 680x0 CPU emulator, while just enough of the OS is simulated by trapping the exec.library calls.
Quote:
I contacted them (I was not the only one) regarding this old code we have that we could still reuse to build narrator.device, but unfortunately they only wanted to do business, and that means $$$ we do not have.
Seriously? Some text to speech modern tools are also free and open source (Kaldi? VOSK?). Screw them. Unless you want to create amiga software. In which case there is no $$$ to make... Use the original leaked source!
jotd is offline  
Old 26 December 2023, 20:12   #8
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,232
Quote:
Originally Posted by Nightfox View Post
Also, who actually owns it anymore? It was taken out of later workbenches due to some ownership issue was it not? Is it now public domain?

The narrator.device is proprietary source code and owned by SoftVoice. CBM, for some reason, never had a valid source code license according to Softvoice. (CBM, at its best, of course). Softvoice is still in business. And no "screw them" is definitely *not* the approach to follow. If anyone thinks that it is "quite obvious" what the device does, then please write an implementation yourself and provide it.



The narrator.device creates human voices from phonems, from base frequences filtered by a model of the human vocal tract, and quite some postprocessing to smoothen the transitions between the phonems as they are used in the English language. The trick seems to be less to generate the right signals, but to make the voice sound half-way realistic, more than just generation of the phonems is necessary.


Thus, the device as such is *not* suitable to speak in any other language. It seems that SoftVoice also offers spanish for their later products, but that is of course not sufficient for full international support.


This being said, I would rather say that the narrator.device was more a show-case for the Amiga (as it was for the Mac - same code, also from SoftVoice) than it served a valuable service. It was a nice feature, but is not really critical.
Thomas Richter is online now  
Old 26 December 2023, 20:13   #9
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,232
Quote:
Originally Posted by jotd View Post
Use the original leaked source!

No, definitely don't. Or how would you like it if I would just steal your property?
Thomas Richter is online now  
Old 26 December 2023, 20:18   #10
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Could something like festival be ported and given a narrator.device compatible interface?
Karlos is offline  
Old 26 December 2023, 20:39   #11
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,196
Quote:
Originally Posted by Thomas Richter View Post
No, definitely don't. Or how would you like it if I would just steal your property?

Yeah right, reverse engineering the original binary isn't stealing anyone property.

Neither is zoning IPF images or cracked ADFs, or creating a huge T***N server with all games & apps on it.

If someone rebuilt a valid ROM file from original kickstart sources that would be a problem by this site conventions (which forbids sharing ROM images because they're still sold), but rebuilding & tuning a tiny part of it? come on.

Last edited by jotd; 26 December 2023 at 21:27.
jotd is offline  
Old 26 December 2023, 21:24   #12
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Quote:
Originally Posted by jotd View Post
Neither is zoning IPF images or cracked ADFs, or creating a huge T***@N server with all games & apps on it.
Please don't paint a target on a useful source.
redblade is offline  
Old 26 December 2023, 21:27   #13
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,104
A "traditional" "clean room" RE of narrator.device seems infeasible, as far as I understand the process, since you can't just resource it and call it a day. You'd need someone to RE the original device and document what it does in enough detail for someone else to re-create it from that documentation. Seems like too much effort for something - that while cool for v1.x - hasn't really been used since. Using another text-to-speech engine seems beside the point to me - we'd want it for the original (nostalgic) sound, right? If it's a new engine just create a new library/device. Copying say+translator.library+narrator.device from KS1.3 still works (and same sort of thing works in whdload).
paraj is offline  
Old 26 December 2023, 22:53   #14
Matt_H
Registered User
 
Matt_H's Avatar
 
Join Date: Jul 2008
Location: Boston, MA
Posts: 945
There’s flite.device for OS4, which is functionally similar. I don’t know how much work would be required (or if it would even be possible) to turn it into a binary-/API-compatible drop-in replacement for narrator.device. But it’s available under a much more permissive license.
Matt_H is offline  
Old 27 December 2023, 08:54   #15
Bruce Abbott
Registered User
 
Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,581
Quote:
Originally Posted by paraj View Post
A "traditional" "clean room" RE of narrator.device seems infeasible, as far as I understand the process, since you can't just resource it and call it a day.
I think it's quite feasible. Reverse-engineering is generally legal. According to the EU Computer Programs Directive a program may be decompiled 'if this is necessary to ensure it operates with another program or device'. It could also fall under 'fair use' if used for educational purposes, eg. to find out how such things work.

Distributing the disassembly would probably be considered a copyright violation because it could be reassembled to identical object code, but you could distribute an explanation of how the code works as this would be all your own work.

However...

Quote:
Using another text-to-speech engine seems beside the point to me - we'd want it for the original (nostalgic) sound, right?
Yes, we would. To ensure that the original sound is preserved the device should not be modified. If someone wants to make an 'improved' narrator device then they should do it from scratch, creating a unique (and hopefully better) implementation which will not sound the same. This could be an interesting project.

However the OP asks about reverse engineering the narrator device to 'extend it' to do things such as 'output to file instead of just outputting straight to audio'. For something like that the device code may not have to be touched at all. I'm betting it outputs through the audio device, so to redirect the audio output to a file you would just have to capture the audio device commands and data. You could do this by patching DoIO etc. without touching the narrator code.

For other things you might need to modify the code. When I want to do this I prefer to patch it rather than changing the source code and reassembling it (which might cause bugs). If code needs to be added I append a hunk to the executable and apply patches that jump into the code in the extra hunk. This could even be done on-the-fly so that no changes are made to the device file on disk.
Bruce Abbott is offline  
Old 27 December 2023, 09:35   #16
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,640
Quote:
Originally Posted by Thomas Richter View Post
Thus, the device as such is *not* suitable to speak in any other language.
I would imagine that translator.library which works at the ASCII text level would need localization more than narrator.device which can speak just about any phoneme and can already be given accents.
Minuous is offline  
Old 27 December 2023, 10:17   #17
rzookol
Registered User
 
Join Date: Mar 2007
Location: Stasin/Poland
Posts: 46
Quote:
Originally Posted by Minuous View Post
I would imagine that translator.library which works at the ASCII text level would need localization more than narrator.device which can speak just about any phoneme and can already be given accents.

But there is already: http://aminet.net/util/libs/translator42.lha with localization support.
rzookol is offline  
Old 27 December 2023, 10:29   #18
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,232
Quote:
Originally Posted by Minuous View Post
I would imagine that translator.library which works at the ASCII text level would need localization more than narrator.device which can speak just about any phoneme and can already be given accents.
No, I afraid that is not correct. As stated before, the narrator *cannot* just generate *any* phonem. It can only generate English phonems (first problem) and second, the processing it does on the phonems is only suitable for English (or, rather, american English). It is very much bound to American speech. For the first point: It definitely lacks phonems that are present in German: German has two types of "ch" sounds (not just the one present in the narrator), and German has "umlaute", in particular the "ü" is missing. There is neither a German "r" (which is probably unspeakable for americans). But the narrator has many diphones that are not present in German. German has very few diphones compared to English. I heard the funniest sounds when Americans attempt to pronounce my last name as it combines all the difficulties of German: Two German "R"s and a German "ch", plus a glottal stop - not possible, unless you are German. American works differently. For the second: The narrator aims at generating a more or less "natural" melody (altering the pitch) in the sentence. This is built into narrator, and not into translator. It also alters the sound of phonems according to its neighboring phonems which is quite typical for English, but rather untypical for German. There is, actually on Aminet, an "internationalized" version of translator you can try to generate phonems from text in another language. I played a lot with it, but the result sounds more or less like an American attempting to speak German. Funny, but not realistic. Much more needs to be done to make narrator speak in any other language, and even its makers (SoftVoice, Inc) only partially support other languages (Spanish they do, but not German). It requires some research and some support from natural speakers to get the voice melody right, and you do not quite have the right feeling for a language without having spoken it for quite a while. My spoken English ("American" actually) is probably quite ok, but you would still recognize my accent, so I would not be the right person to create algorithms for American speech, same as Softvoice not being in the right position (without native support) for German.
Thomas Richter is online now  
Old 27 December 2023, 10:42   #19
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,232
Quote:
Originally Posted by Bruce Abbott View Post
I think it's quite feasible. Reverse-engineering is generally legal.
No, it is "generally illegal" in an appropriate (legal) use of the word "general". It is only legal in certain exceptions (thus not "general"), and only if you want to establish an interface to an otherwise closed system. Thus, for example, it would be legal to reverse engineer an internet protocol such as SMB to create an SMB client on Amiga (except that SMB is documented) or to reverse engineer the "word format" (except that it is now documented) to be able to read word documents.


But the "narrator" does not have such an interface. The two interfaces it has (phonems in - audio out) are perfectly open and documented, so nothing in that direction would require any type of reverse engineering.


What you could do is a patent research and see whether any of the algorithms the narrator depends upon were patented. If so, they should be usable without fee by now as the patents would have run out.


If that is not the case, you are stuck. It is a proprietary product by a private entity, and it is theirs, not yours. If you want to have a text to speech engine, there are (as already pointed out) alternatives you can pick from with more liberal licenses.


Quote:
Originally Posted by Bruce Abbott View Post
Distributing the disassembly would probably be considered a copyright violation because it could be reassembled to identical object code, but you could distribute an explanation of how the code works as this would be all your own work.
The act of obtaining that information would still be illegal since it does not fall into the above exception clause. Anyhow, this would help little. The tricky part is really not getting "how" the code works, but "why" it works the way it works, and the disassembly (and even the source code) provides very little details of that. It requires the knowledge of one of its authors or any other expert in speech synthesis to make this code suitable for producing other languages, or to extend it.





Quote:
Originally Posted by Bruce Abbott View Post


owever the OP asks about reverse engineering the narrator device to 'extend it' to do things such as 'output to file instead of just outputting straight to audio'. For something like that the device code may not have to be touched at all.
Indeed, and that is a simple exercise. It is an "audio-lookalike" (or "hear-alike"?) of the CMD utility which redirects printer output to disk, and that is a relatively easy exercise.
Thomas Richter is online now  
Old 27 December 2023, 10:50   #20
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,196
If you don't like illegal stuff, stay away from EAB, as most of the stuff exchanged here is "abandonware".
jotd is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can narrator.device output to raw file? Nightfox Coders. System 7 30 April 2020 14:39
A3640 , Reverse engineered! Chucky support.Hardware 65 27 December 2017 05:28
narrator.device via assembly h0ffman Coders. System 6 30 July 2016 19:50
Narrator.device thinlega request.Apps 2 31 May 2004 06:37
narrator.device? th4t1guy support.WinUAE 4 23 April 2004 15:27

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09761 seconds with 13 queries