Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
SimTX Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
SimTX API v24/Packets/SampleBlock
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{SimTX API v24 navigation}} {{SimTX packet v24 | name = SampleBlock | id = 3 | hex = 0x03 | direction = c2s | session = [[SimTX API v24/Transmitter session|Transmitter]] | size = 4 + 4n bytes, or 8 + 2n bytes (compact) | permission = None | group = transmitter }} '''SampleBlock''' carries samples for the server to transmit. After [[SimTX API v24/Packets/TxAccept|TxAccept]], a client with role 2 streams these continuously, in real time, at the <code>sampleRate</code> it declared. The block has two forms: plain 32-bit floats for any source, and a compact 16-bit form for IQ sources. == Layout == The sign of the first field selects the form. {| class="wikitable" ! Field !! Type !! Description |- | <code>packetId</code> || <code>u8</code> || Always <code>3</code>. |- | <code>n</code> || <code>i32</code> || Positive: plain form with ''n'' values. Negative: compact form with β''n'' values. Zero is invalid. |- | ''plain form'' || || |- | <code>samples</code> || <code>n Γ f32</code> || Sample values. 1 β€ ''n'' β€ 65,536. |- | ''compact form'' || || |- | <code>scale</code> || <code>f32</code> || Finite and β₯ 0. |- | <code>samples</code> || <code>(βn) Γ i16</code> || Value = <code>q Γ scale / 32767</code>. β''n'' must be even and at most 65,536. |} == Sample content == {| class="wikitable" ! Source type !! Content !! Processing |- | <code>AUDIO_STREAM</code>, <code>MICROPHONE</code>, <code>PIPEWIRE</code> || Mono audio, one value per sample, nominal range Β±1. Plain form only. || Multiplied by <code>audioGain</code> and clipped to Β±100, then modulated. |- | <code>GNU_RADIO_IQ</code> || Complex baseband, I and Q interleaved (so ''n'' is even), centred on the carrier. Either form. || Multiplied by <code>audioGain</code> and clipped to Β±2.0. Average power is normalised to at most 1.0, which corresponds to <code>powerWatts</code>. |} A block may contain any number of samples up to the limit; blocks of 10β50 ms are a good compromise between overhead and latency. == Errors == The connection is closed without a message for <code>n = 0</code>, more than 65,536 values, a compact block on an audio source, an odd value count on an IQ source, or a negative or non-finite compact scale. == Pacing == Send samples at the declared rate. Input faster than 1.05 Γ that rate, after a burst allowance of about 2 seconds, is discarded a whole block at a time. When the server's buffer is 90 % full, it stops reading the socket and TCP flow control holds the client back. Watch <code>bufferSeconds</code> in [[SimTX API v24/Packets/TxTelemetry|TxTelemetry]]. == Example == Four audio samples: <syntaxhighlight lang="text"> 03 packetId 3 00 00 00 04 n = 4 00 00 00 00 0.0 3F 00 00 00 0.5 3F 80 00 00 1.0 BF 00 00 00 -0.5 </syntaxhighlight> == See also == * [[SimTX API v24/Transmitter session#Streaming|Streaming]] {{SimTX API v24 navbox}} [[Category:SimTX API v24]]
Summary:
Please note that all contributions to SimTX Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
SimTX Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:SimTX API v24 navbox
(
edit
)
Template:SimTX API v24 navigation
(
edit
)
Template:SimTX packet v24
(
edit
)