VolumeOutput #904
-
for volume print testing i copy i2s data to VolumeOutput and below is plotter result . now form this result how can we find what the actual volume of i2s stream was because its oscillating ? I2SStream i2sIn; loop{ |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The VolumeOutput is just determining the maximum sample value that is copied to it. If you don't specify any value in the StreamCopy, the number of samples is 1024. If the sample rate is too high and is not capturing at least 1 full wave cycle, this number might not be stable. You could try to increase the copy size or decrease the sample rate. However this looks more that you messed up with the number of channels or bits_per_sample and you did not configure them to match on the input and output side. Did you try to print the values with CsvOutput so that you can reproduce the result ? ps: dont do Serial.println(String(out1.volume())); This is pretty bad because you unnecessarily allocate a String on the heap: just call Serial.println(out1.volume()); |
Beta Was this translation helpful? Give feedback.
-
I committed a correction with a test case. This should resolve your issue... |
Beta Was this translation helpful? Give feedback.
-
Not sure if this looks right or not because I do not know what you were recording: If you record a constant sine tone the volume should be quite constant as well... |
Beta Was this translation helpful? Give feedback.
I committed a correction with a test case. This should resolve your issue...