Writing your own background music subsystem

When writing your own background music custom server and music players, you must consider how to pass dynamic voice data to a custom server.

Passing dynamic voice data to a custom server
For this, you will need a program that accepts data supplied in a dynamic stream, and uses the custom server API (similar to the pl_elem music player program). For example, your music data may come from a line-in on an Ultimedia Audio adapter.

You must set the dBm level in the CA_Play_Voice_Stream custom server API call. It is your responsibility to ensure that Blueworx Voice Response never receives audio data which exceeds this peak dBm level.

To find out this what this level should be, run your program to record some incoming audio data. Use a sample that contains the loudest sound the source will send. Use CA_Import_Voice to convert the voice data to an elements structure, then use CA_Get_Element_Info to find the dBm level.

Note: If the dBm level is too high you may damage your telephone provider’s equipment!

When you know what the dBm level is, your music player can pass this dBm level to CA_Play_Voice_Stream.

Use cvelem off-line to pre-process music into elements more efficiently than using CA_import() and CA_Play_Voice_Elements() dynamically.