Operator RtpDecode
The RtpDecode Operator converts an input blob with 8-bit μ-law encoded PCM samples into uncompressed 16-bit samples. The output stream attribute with the 16-bit samples must be of type blob and the 16-bit samples are stored in little endian signed integer format.
Example
use com.teracloud.streams.network.rtp::RtpDecode;
composite Main {
param
expression<rstring> $filename: getSubmissionTimeValue("filename", "data/sample_rtp_decode_basic_ulaw.gsm" );
graph
stream<rstring filename, blob mulawspeech> MuLawSamplesStream = FileSource() {
param
file: $filename;
format: block;
blockSize: 128u;
output MuLawSamplesStream:
filename = $filename;
}
stream<rstring filename, blob mulawspeech, blob decoded, uint64 noSamples, rstring conversationId> OutStream = RtpDecode(MuLawSamplesStream) {
param
payload: mulawspeech;
output OutStream:
conversationId = filename,
decoded = getPcmPayload(),
noSamples = getNumberOfSamples();
}
}
Summary
- Ports
- This operator has 1 input port and 1 output port.
- Windowing
- This operator does not accept any windowing configurations.
- Parameters
- This operator supports 1 parameter.
Required: payload
- Metrics
- This operator does not report any metrics.
Properties
- Implementation
- C++
- Threading
- Always - Operator always provides a single threaded execution context.
- Ports (0)
-
The input port with an blob attribute containing the PCM samples.
- Properties
-
- Optional: false
- ControlPort: false
- TupleMutationAllowed: false
- WindowingMode: NonWindowed
- WindowPunctuationInputMode: Oblivious
- Assignments
- This operator allows any SPL expression of the correct type to be assigned to output attributes.
- Output Functions
-
- DefaultFunctions
-
- <any T> T AsIs(T)
-
The default function for output attributes. By default, this function assigns the output attribute to the value of the input attribute with the same name.
- uint64 getNumberOfSamples()
-
Return the number of converted PCM samples in the current tuple.
- blob getPcmPayload()
-
Return the converted PCM payload (uncompressed 16-bit little endian integer samples).
- Ports (0)
-
The output port with an blob attribute containing the converted PCM samples. The other attributes are auto assigned from input port to output port.
- Properties
-
- Optional: false
- TupleMutationAllowed: true
- WindowPunctuationOutputMode: Preserving
Required: payload
- payload
-
The input stream attribute with the 8 bit mulaw encoded PCM samples to convert.
- Properties
-
- Type: blob
- Cardinality: 1
- Optional: false
- ExpressionMode: Attribute
- RtpDecode
-
stream<${outputSchema}> ${outputStream} = com.teracloud.streams.network.rtp::RtpDecode(${inputStream}) { param payload: ${inputStream-blob-attribute}; output ${outputStream}: ${attributeAssignments} }