how to insert data like dynamic label...

Dani AI

Generated

described increasing a 480‑byte DAB frame to 576 bytes to "insert 96 bytes". That change can be done two very different ways depending on what those 96 bytes are and where they belong: (a) as ancillary/metadata carried by the DAB system (the safe, standard way), or (b) by splicing bytes into an encoded audio frame (risky — likely to break decoders). As noted, the exact frame format (raw PCM vs encoded MP2/codec container vs transport-level block) is the critical detail.

DAB has a built‑in mechanism for carrying labels and small data without touching audio bitstreams: Programme Associated Data (PAD) and related MOT/image services. Use those instead of rewriting audio frames when you want dynamic labels or small payloads — they are how receivers expect extra data to be carried (Digital Audio Broadcasting). If you must change an encoded frame, you need to parse and update every format field and error check (length fields, CRCs, bit alignment) so decoders remain in sync.

Practical, minimal approach for byte-level insertion when operating at container/subchannel level (not inside a codec bitstream): parse header to find insert offset, allocate a new buffer, and move segments around. Example C# utility to insert bytes into a frame buffer:

byte[] InsertBytes(byte[] frame, byte[] insert, int offset)
{
    if (offset < 0 || offset > frame.Length) throw new ArgumentOutOfRangeException(nameof(offset));
    var result = new byte[frame.Length + insert.Length];
    Buffer.BlockCopy(frame, 0, result, 0, offset);
    Buffer.BlockCopy(insert, 0, result, offset, insert.Length);
    Buffer.BlockCopy(frame, offset, result, offset + insert.Length, frame.Length - offset);
    return result;
}

Cautions: do not alter codec frame payloads unless you fully understand framing and CRCs; insertion may need bit-level shifts, not byte copies. After any change, recompute/repair header fields and checksums, reassemble transport frames, and validate with a real decoder. As requested earlier, knowing the codec/container and whether those 96 bytes are metadata or audio will determine the correct, decoder‑safe method.

Recommended Answers

All 4 Replies

What do you mean?

Label lbl=new Label();
lbl.Text="What do you mean?";
SomeContainer.Controls.Add(lbl);

how to insert data like dynamic label...

1.can u tel me where u want to insert data
while runtime or what. expecting more explanation

i wan to insert data in a dab audio frame... example: i got a frame 480bytes... then i will increase the frame size to 576 bytes... and i need to insert 96 bytes of data that 1 wan...

so how to write the code? or got any structure to show it?

as far as i understand your question is : how you insert a object in a audio frame at runtime ?

could you post some code on how the audio frame looks , or how is the data formated ? in a byte array ? or something ? anything is better than what you have posted so far.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.