This saves code space in builds which use link-time optimization.
The optimization drops the untranslated strings and replaces them
with a compressed_string_t struct. It can then be decompressed to
a c string.
Builds without LTO work as well but include both untranslated
strings and compressed strings.
This work could be expanded to include QSTRs and loaded strings if
a compress method is added to C. Its tracked in #531.
I2SOut.
The API is almost the same except the frequency attribute has been
renamed to sample_rate so that its less likely to be confused with
frequencies within the audio itself.
Fixes#263.
Changes:
* New faster filter loop, by @ladyada. New filter coefficients as well.
* Turn on microphone clock when PDMIn object is created, and run it all the time, so the user code doesn't have to wait for microphone startup, which can be 10ms or even 100ms.
* Wait for microphone startup when PDMIn is first created, based on new optional parameter microphone_startup in seconds (takes a float).
* record() returns number of samples actually recorded, so you can see if it's not keeping up.
* Fix buffer overflow errors when buffer size was not a multiple of 16 or something like that.
* Tweak a few peripheral settings.
* Minimum sampling frequency is now 16kHZ or so, because 8kHz runs microphone at only 0.5MHz, which is too slow for many mics.
Note: I tried 128x oversampling instead of 64x, but the code cannot keep up at 24kHz or above sampling. 128x would reduce the high-frequency noise by 6db.