Segments
Each content item can have multiple segments. For instance, an article typically includes a title, a summary and a body. The body itself typically contains multiple paragraphs, which may include multimedia elements such as images, audio clips, and videos. These individual components are referred to as segments. Segmenting content enables flexibility, allowing for a range of features when combined with the BeyondWords Player. These include skipping between segments, initiating playback from specific segments (e.g., clicking play on a paragraph), and highlighting segments during playback (e.g., paragraph highlighting as it plays). You have three options when it comes to generating audio:auto_segment, manual_segment, or audio_upload.
auto_segment
We recommend theauto_segment option for publishers seeking a simple way to generate audio versions of their articles.
To use this option set type property to auto_segment whenever you create or update a content item.
Using this option, you are required to submit data for the body property, with the title and summary properties being optional additions.
Once submitted, BeyondWords will automatically segment the body data into segments. In the initial response, the segments will be an empty array, as automatic segmenting is an asynchronous operation. However, once the audio has been generated and you retrieve a content item using the ?segments=full query parameter, you will be able to view the individual segments.
Example request and responses:
manual_segment
We recommend themanual_segment option for publishers seeking enhanced control over the audio conversion of their content. This is particularly beneficial for those who wish to integrate the content API into their editorial interface or create videos with multiple images (coming soon).
To use this option set type property to manual_segment whenever you create or update a content item.
Using this option, you should not submit any data to the title, body or summary properties.
Instead, you will need to submit an array of one or multiple segments.
For each segment you submit you will need to submit data to the following properties:
| Property | Options |
|---|---|
section | Use this property define the section type of a segment as either title, summary or body. |
content_type | If content_type is text then submit plain text to be converted into audio. If no voice_id is submitted then the audio will be generated with the default project voices assigned title, summary or body in the project. |
If content_type is audio then submit an audio_url to be uploaded. | |
If content_type is image then submit an image_url to be uploaded. |
audio_upload
We recommendaudio_upload option for publishers that want to host podcasts or human-recorded articles on BeyondWords and leverage the BeyondWords Player, podcast feeds and analytics.
To use this option set the type property to audio_upload whenever you create or update a content item.
Using this option, you should submit a title, body and segments array with a single segment object with section set to title, content_type set to audio and an audio_url with a URL to the audio file to be upload.
The title and body text will not be converted into audio. However the text may be present in the player or podcast feeds depending on your player or playlist settings.
Example POST request