Download the PHP package techworker/ssml without Composer

On this page you can find all versions of the php package techworker/ssml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ssml

techworker/ssml

This library allows you to easily generate Speech Synthesis Markup Language (SSML) with PHP.

Usage

This library provides a fluent interface to build SSML strings. It tries to offer all elements that are defined in the specification, but since most of the synthesizers are satisfied with a "simple" SSML subset or some are bending the specification to it's own needs, this library does not force you into the specification and even offers you ways to go beyond the specification.

It ships with a SSML validator for Amazon Alexa.

So in short:

You are able to generate the SSML that adhere's to the SSML specification, but it is simple to avoid the rules and generate what you need.

Code peek

outputs

Installation

Add this to your composer.json

.. or use the following command on your command line:

composer require techworker/ssml

After that, you can immediately start to build your SSML.

The fluent interface

To get started, you'll have to create a new speak (root) element. This can be done in numerous ways, but the preferred way is to use the \Techworker\Ssml\SsmlBuilder class.

This will give you a new Element called Speak (which ends up as a <speak> node) and you can go on from here to add additional nodes.

To give you an example on how you can use the library:

This command will end up as:

There are two different types of elements. One element type is the container element. This is an element that can contain other elements.

The other type is a leaf element which is not capable of holding other elements as children.

If you add a container element with the fluent interface, you will get the container element itself back and can continue to add child elements to the container.

If you add a leaf element, you will get back the container element, that hosts the previously added leaf element. So to fetch the leaf element, you'll have to call the fetch method.

Example

There are 2 helper functions up and root to help you to traverse up in the element tree.

Example

Supported Elements (tags)

SSML is used by various parties and some are just using a subset of the specification and some are extending the specification to it's needs. The following list describes the elements + attributes which are natively supported. Elements that are missing an attribute of your choice or are absent completely can still be created.

speak

A SSML string is always surrounded by a <speak> tag. It will be created automatically, whenever you call the \Techworker\Ssml\SsmlBuilder::factory(); method.

Outputs

audio

Example

Outputs

break

Example

Outputs

p (paragraph)

Example

Outputs

s (sentence)

Example

Outputs

phoneme

Example

Outputs

say-as

Example

Outputs

The format attribute is empty if not provided or set to null .

w (word)

Example

Outputs

Custom elements

If you need a custom element for a synthesizer that adds additional elements to the specification, you can simply create them.

Example

Outputs

Custom attributes

If you need to add another attribute to an element that is not supported yet, you can use the attr function on the element.

Example

Outputs

Validation

To validate the resulting SSML against specifications from a vendor, you can use specification validators.

This library ships with a Amazon Alexa validator.


All versions of ssml with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package techworker/ssml contains the following files

Loading the files please wait ....