Adam’s May 2022 Meeting Summary

  • Guest Speaker: Delphi memory management – Dalija Prasnikar
  • Anonymous Methods with and without Delphi – Dr Kevin Bond
  • Speech APIs in Delphi and C++ Builder – Mark Jacobs, Richard Hatherall, Ian Hamilton

Adam’s Summary

Another on-line meeting hosted by Jason Chapman on Zoom

Guest Speaker: Delphi memory management – Dalija Prasnikar

Dalija Pranskikar reviewed the content of her book Delphi Memory Management, and had a general discussion with attending members, answering their questions.

It was a fairly informal session, quite high on technical detail. It included discussion of TComponent’s Notification pattern for informing linked components about changes in state of sub-components, pretty long discussions on reference counting, and how this differs for interfaces and classes, the fact anonymous methods have to do complex things to exist, with significant implications. I’m not sure I followed all this particularly as memory management has never been an area I am particularly good at, but it was still a useful session.

Dalija discussed the Delphi Next Generation Compiler which she feels has been unfairly criticised,

ARC v. Garbage collection: Dalija is far more positive about ARC as the programmer is always in control. Garbage collection is by its nature automated to a point where too much control is released.

FastMM4 v FastMM5: The main innovation with MM5 is improvement in contexts of multi-threading. Dalija feels if you don’t use multi-threading you don’t really need FastMM5. She also discussed ScaleMM as a further significantly more efficient memory manager for large-scale multi-threaded programmes. This is a commercial product you buy to add in to your sysetm.

Anonymous Methods with and without Delphi – Dr Kevin Bond

Kevin gave a really good explorative talk discussing these topics, kicking off from the differences between Delphi/Pascal which is Object-oriented/Event-driven and Recurisve/Function-based coding.

Anonymous methods and Functional programming go together well as the types of “purity” and high levels of encapsulation required by Functional programming integrate well with Some basics of Functional programming were covering, the strong concept of a “pure” function (without side-effects), the fact that Functional programming has no assignment operator. The pattern that results of a function should depend only on its parameters (Bob Martin). Functional programming models slot in far better to multi-threading and big-data programming requirements.

After this introduction, Kevin went through a really useful set of code-examples of Anonymous methods, gradually undertaking more and more complex steps, until he ran out of time. There are a few examples left to work through, which might be covered in a future session.

Speech APIs in Delphi and C++ Builder – Mark Jacobs, Richard Hatherall, Ian Hamilton

Mark Jacobs, Richard Hatherall and Ian Hamilton each presented their own solutions for Text to Speech.

Mark has imported the Microsoft Speech Library, adding a component directly to the pallet of his BCB5 IDE. He then showed demos passing relatively straight forward XML Formatted text, including the text to be read as an element. The results were impressive, with a pretty realistic voice and fair rendition of the text. The microsoft engine includes a small selection of voices (male female, UK-English, USA-Englist) and allows playback at lower and higher pitches and faster and slower speeds. Mark showed how to insert XML tags into the text to slightly alter the intonation, randomly, so you would hear the words spoken slightly differently each time.

Richard is the author of the AWS components which are built into Delphi Enterprise. He has recently added support for the AWS “Polly” speech engine to these components. Polly offers a web-based text-to-speech service. You must have a subscription to the AWS Polly service, and send text that needs to be spoken to the Amazon server. There it is encoded into a stream of data which can be saved locally as an MP3 and played back. Polly is an incredible service. The voice quality is extraordinary, programmers can pass up text with XML-tags (similar to the Microsoft Speech Library). These tags add a very wide range of additional expressiveness to the speech. The service costs about $4.00 for one million characters of text with a “basic” (very good) voice. It is $16 for one million characters of text with a “neural” (excellent, highly expressive) voice.

Richard discussed SSML (Synthesized Speech Markup Language) which is a global standard. It is worth looking at this if you are going to do text to speech as it seems to be ubiquitous in this area.

Ian’s talk ranged across several of the other ways of achieving text-to-speech. He showed the TMS Software text-to-speech component, some Stephen Ball demos which access the Azure and Google text-to-speech services. Interestingly all the services showed surprising similarity, and were all very high quality. All the on-line versions (including AWS) offered a very wide range of language support, such as voices for Austrian or Indian-English.

It felt like a packed meeting, and I learned a lot. See you all next month.