VS1063 play G722 stream

Designing hardware that uses VLSI Solution's devices as slave codecs such as an external MP3 decoder chip for a host microcontroller.
Post Reply
madnik
User
Posts: 6
Joined: Wed 2017-02-08 2:52

VS1063 play G722 stream

Post by madnik » Mon 2019-01-28 16:13

Hello!
I have a question about working with audio G.722 codec.
I have two devices. The data is transmitted over the air between them.
It turns out that in order to start decoding on the receiver, I need to first turn on the receiver, then the transmitter. Is it possible for the transmitter to encode all time, and the receiver to turn on at any time? As I understand at the beginning of the encoding, some start information is required that is needed for the VS to determine the codec. How can I enable decoding at any place in the stream without rebooting the encoder?

User avatar
pasi
VLSI Staff
Posts: 1585
Joined: Thu 2010-07-15 16:04

Re: VS1063 play G722 stream

Post by pasi » Wed 2019-01-30 11:52

Because you know the format (and samplerate), you can generate a fixed header in the receiver and send that to vs1063 before you start sending the data.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

madnik
User
Posts: 6
Joined: Wed 2017-02-08 2:52

Re: VS1063 play G722 stream

Post by madnik » Wed 2019-01-30 17:59

Yes, thanks. I have already found a solution.
For my case:
1) For transmitter

Code: Select all

// Set bit 10 of SCI_AICTRL3, the RIFF WAV header is not generated.
vs_write_sci(SCI_RECMODE, RM_63_FORMAT_G722_ADPCM  | RM_63_ADC_MODE_MONO | RM_63_NO_RIFF);
2) For receiver

Code: Select all

// header for G722 
const uint8_t header[] = {
	0x52, 0x49, 0x46, 0x46,
	0xFF, 0xFF, 0xFF, 0xFF,
	0x57, 0x41, 0x56, 0x45,
	0x66, 0x6D, 0x74, 0x20,
	0x14, 0x00, 0x00, 0x00,
	0x8F, 0x02, 0x01, 0x00,
	0x80, 0x3E, 0x00, 0x00,
	0x40, 0x1F, 0x00, 0x00,
	0x01, 0x00, 0x04, 0x00,
	0x02, 0x00, 0x02, 0x00,
	0x64, 0x61, 0x74, 0x61,
	0xFF, 0xFF, 0xFF, 0xFF
};
	
// send header before stream
vs_write_sdi(header, SDI_MAX_TRANSFER_SIZE);
vs_write_sdi(&header[SDI_MAX_TRANSFER_SIZE], sizeof(header) - SDI_MAX_TRANSFER_SIZE);

Post Reply