Required to send same amount of data with decoding and without decoding . #796
-
Sender logic VolumeStream volume(i2sStream); At receiver end .... Is some thing wrong in above technique ? Although its working and i am getting proper audio out at receiver . But my concerns is : And my i2s sample rate s 44.1kHZ so from this total bytes / seconds will be 44100x2( because 16 bits ) = 88200/ bytes per seconds . The difference only is 88500-88200 =6000 bytes we can say bytes send rate are approximately equal because 6k bytes difference is not huge . So my question is why without decoding and with decoding i need to send same amount of data ? or else their is some other thing which i am ignoring and i don't know it ? pls guide |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
I don't understand your question. I would expect that the major thing to worry is that you keep the effective transmitted data rate (after decoding) below the capacity. There is no connection between the amount of data that you write and the amount of data that is sent. This is decided by the Decoder or Encoder. With what effective rate are you producing the data ? Please note that if you take an I2SStream at the source it will provide at the sampling rate. If you use a file or sine generator, it will be much faster! |
Beta Was this translation helpful? Give feedback.
-
My point is my i2sstream source is @44100 @ 16 Bits so without encoder/decoder i need to process around 88200 bytes . am I correct ?? Now with reading bytes from SBC encoder and send to espnow i must send maximum around 82,500 bytes which is almost equal to above raw data 88200 bytes . so why i need this large data to send even if i am using a sbc encoder , i was expecting almost half of data to send as compare to original raw data because the encoder will compress the data .. I am correct ? |
Beta Was this translation helpful? Give feedback.
-
Yes 44100 at 16 bits_per_sample is 88200 bytes if you use 1 channel! The encoder is compressing the audio so you can send at a lower rate. You can calculate the ratio by calling bytesUncompressed() / bytesCompressed() I don't know where the 82,500 is coming from, but honestly I am not sure what the max transmission speed of esp-now with the updated idf version is ? Did you try the FAST_ESP_NOW_HACK |
Beta Was this translation helpful? Give feedback.
-
82500 is espnow maximum data rate per seconds which observe in my case . which i think its very large because its almost equal to raw data which is 82000 bytes per seconds @44100 16 bit channel 1 . am i correct ? I was expecting almost half of data because encoder will compress the data . why need to send almost 82500 bytes per seconds to get proper audio at out put ?? bytesCompressed gives me 76 . from this 76 how to calculate the at what rate should send data to espnow ? with bytescompreesd i am reading data from encoder like this now how to calculate or lower the espnow data rate ?? |
Beta Was this translation helpful? Give feedback.
-
I just made some tests of my own and I was getting the following decoded rates using audio generated by a sine generator: For me the decoding examples are working like a charm: https://github.com/pschatzmann/arduino-audio-tools/tree/main/examples/examples-communication/esp-now/codec |
Beta Was this translation helpful? Give feedback.
I don't understand your question. I would expect that the major thing to worry is that you keep the effective transmitted data rate (after decoding) below the capacity.
There is no connection between the amount of data that you write and the amount of data that is sent. This is decided by the Decoder or Encoder.
With what effective rate are you producing the data ? Please note that if you take an I2SStream at the source it will provide at the sampling rate. If you use a file or sine generator, it will be much faster!