From 86a1818da5ae8a9231388b9556ab9d8392bb3c98 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sun, 28 Nov 2021 10:52:33 -0800 Subject: [PATCH] Add codespell to CI checks (#450) --- .github/workflows/pr-or-master-push.yml | 17 +++++++++++++++++ README.md | 2 +- .../PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino | 2 +- .../PlayWAVFromFunction/PlayWAVFromFunction.ino | 2 +- .../StreamMP3FromHTTPToSPDIF.ino | 2 +- src/AudioFileSourceFunction.cpp | 2 +- src/AudioFileSourceFunction.h | 2 +- src/AudioGeneratorMIDI.cpp | 2 +- src/AudioOutputSPDIF.cpp | 2 +- src/AudioOutputSPDIF.h | 2 +- src/driver/SinglePinI2SDriver.cpp | 8 ++++---- src/libflac/stream_decoder.c | 12 ++++++------ src/libhelix-mp3/RPSL.txt | 2 +- src/libhelix-mp3/assembly.h | 4 ++-- src/libhelix-mp3/scalfact.c | 2 +- src/libogg/README.md | 4 ++-- src/libtinysoundfont/README.ESP8266 | 2 +- src/libtinysoundfont/tsf.h | 4 ++-- src/opusfile/opusfile.h | 4 ++-- tests/common.sh | 2 +- 20 files changed, 48 insertions(+), 31 deletions(-) diff --git a/.github/workflows/pr-or-master-push.yml b/.github/workflows/pr-or-master-push.yml index 52bf8a9..fcbd095 100644 --- a/.github/workflows/pr-or-master-push.yml +++ b/.github/workflows/pr-or-master-push.yml @@ -93,3 +93,20 @@ jobs: - uses: arduino/arduino-lint-action@v1 with: library-manager: 'update' + +# Validate orthography + code-spell: + name: Check spelling + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Run codespell + uses: codespell-project/actions-codespell@master + with: + skip: ./src/libmad,./src/libhelix-aac,./src/libopus + ignore_words_list: ESP8266,esp8266,esp,dout,DOUT,ser,ans,inout,numer,hist diff --git a/README.md b/README.md index 6ff31be..3fd7101 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ AudioFileSourcePROGMEM: Reads a file from a PROGMEM array. Under UNIX you can AudioFileSourceHTTPStream: Simple implementation of a streaming HTTP reader for ShoutCast-type MP3 streaming. Not yet resilient, and at 44.1khz 128bit stutters due to CPU limitations, but it works more or less. ## AudioFileSourceBuffer - Double buffering, useful for HTTP streams -AudioFileSourceBuffer is an input source that simpy adds an additional RAM buffer of the output of any other AudioFileSource. This is particularly useful for web streaming where you need to have 1-2 packets in memory to ensure hiccup-free playback. +AudioFileSourceBuffer is an input source that simply adds an additional RAM buffer of the output of any other AudioFileSource. This is particularly useful for web streaming where you need to have 1-2 packets in memory to ensure hiccup-free playback. Create your standard input file source, create the buffer with the original source as its input, and pass this buffer object to the generator. ```cpp diff --git a/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino b/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino index 3c12788..50b0ade 100644 --- a/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino +++ b/examples/PlayFLAC-SD-SPDIF/PlayFLAC-SD-SPDIF.ino @@ -8,7 +8,7 @@ // Espressif Audio Development Framework at: // https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/audio-samples.html // -// On ESP8266 you might need to reencode FLAC files with max '-2' compression level +// On ESP8266 you might need to re-encode FLAC files with max '-2' compression level // (i.e. 1152 maximum block size) or you will run out of memory. FLAC files will be // slightly bigger but you don't loose audio quality with reencoding (lossles codec). diff --git a/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino b/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino index fe0cc89..9af90e0 100644 --- a/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino +++ b/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino @@ -44,7 +44,7 @@ void setup() { // param : float (current time [sec] of the song) // return : float (the amplitude of sound which varies from -1.f to +1.f) // - // sound function can be registerd only one or the same number with channels + // sound function can be registered only one or the same number with channels // if the channels > 1 && the number of function == 1, // same function are used to generate the sound in every channel // diff --git a/examples/StreamMP3FromHTTPToSPDIF/StreamMP3FromHTTPToSPDIF.ino b/examples/StreamMP3FromHTTPToSPDIF/StreamMP3FromHTTPToSPDIF.ino index b082f7a..ef54290 100644 --- a/examples/StreamMP3FromHTTPToSPDIF/StreamMP3FromHTTPToSPDIF.ino +++ b/examples/StreamMP3FromHTTPToSPDIF/StreamMP3FromHTTPToSPDIF.ino @@ -104,7 +104,7 @@ void setup() // Commented out for performance issues with high rate MP3 stream //buff->RegisterStatusCB(StatusCallback, (void*)"buffer"); - // Set SPDIF outout + // Set SPDIF output out = new AudioOutputSPDIF(); mp3 = new AudioGeneratorMP3(); diff --git a/src/AudioFileSourceFunction.cpp b/src/AudioFileSourceFunction.cpp index 9e86eff..885defa 100644 --- a/src/AudioFileSourceFunction.cpp +++ b/src/AudioFileSourceFunction.cpp @@ -1,6 +1,6 @@ /* AudioFileSourceFunction - Audio ouptut generator which can generate WAV file data from function + Audio output generator which can generate WAV file data from function Copyright (C) 2021 Hideaki Tai diff --git a/src/AudioFileSourceFunction.h b/src/AudioFileSourceFunction.h index 6c41229..94b88d6 100644 --- a/src/AudioFileSourceFunction.h +++ b/src/AudioFileSourceFunction.h @@ -1,6 +1,6 @@ /* AudioFileSourceFunction - Audio ouptut generator which can generate WAV file data from function + Audio output generator which can generate WAV file data from function Copyright (C) 2021 Hideaki Tai diff --git a/src/AudioGeneratorMIDI.cpp b/src/AudioGeneratorMIDI.cpp index a76e757..5f1c5f3 100644 --- a/src/AudioGeneratorMIDI.cpp +++ b/src/AudioGeneratorMIDI.cpp @@ -364,7 +364,7 @@ void AudioGeneratorMIDI::PrepareMIDI(AudioFileSource *src) int AudioGeneratorMIDI::PlayMIDI() { /* Continue processing all tracks, in an order based on the simulated time. - This is not unlike multiway merging used for tape sorting algoritms in the 50's! */ + This is not unlike multiway merging used for tape sorting algorithms in the 50's! */ do { /* while there are still track notes to process */ static struct track_status *trk; diff --git a/src/AudioOutputSPDIF.cpp b/src/AudioOutputSPDIF.cpp index 53483d4..c1370d7 100644 --- a/src/AudioOutputSPDIF.cpp +++ b/src/AudioOutputSPDIF.cpp @@ -3,7 +3,7 @@ S/PDIF output via I2S - Needs transciever from CMOS level to either optical or coaxial interface + Needs transceiver from CMOS level to either optical or coaxial interface See: https://www.epanorama.net/documents/audio/spdif.html Original idea and sources: diff --git a/src/AudioOutputSPDIF.h b/src/AudioOutputSPDIF.h index 5da160b..7cb194d 100644 --- a/src/AudioOutputSPDIF.h +++ b/src/AudioOutputSPDIF.h @@ -3,7 +3,7 @@ S/PDIF output via I2S - Needs transciever from CMOS level to either optical or coaxial interface + Needs transceiver from CMOS level to either optical or coaxial interface See: https://www.epanorama.net/documents/audio/spdif.html Original idea and sources: diff --git a/src/driver/SinglePinI2SDriver.cpp b/src/driver/SinglePinI2SDriver.cpp index 3d08efa..c2d2280 100644 --- a/src/driver/SinglePinI2SDriver.cpp +++ b/src/driver/SinglePinI2SDriver.cpp @@ -3,7 +3,7 @@ ESP8266Audio I2S Minimal driver Most of this code is taken and reworked from ESP8266 Arduino core, - which itsef is reworked from Espessif's I2S examples. + which itself is reworked from Espessif's I2S examples. Original code is licensed under LGPL 2.1 or above Reasons for rewrite: @@ -196,7 +196,7 @@ void SinglePinI2SDriver::setDividers(uint8_t div1, uint8_t div2) // Ensure dividers fit in bit fields div1 &= I2SBDM; div2 &= I2SCDM; - // trans master(active low), recv master(active_low), !bits mod(==16 bits/chanel), clear clock dividers + // trans master(active low), recv master(active_low), !bits mod(==16 bits/channel), clear clock dividers I2SC &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD)); // I2SRF = Send/recv right channel first // I2SMR = MSB recv/xmit first @@ -249,7 +249,7 @@ void SinglePinI2SDriver::startI2S() I2SFC |= I2SDE; // Enable DMA // I2STXCMM, I2SRXCMM=0 => Dual channel mode, RX/TX CHAN_MOD=0 I2SCC &= ~((I2STXCMM << I2STXCM) | (I2SRXCMM << I2SRXCM)); - // Set dividers to something resonable + // Set dividers to something reasonable currentRate = 0; setRate(44100); // Start I2S peripheral @@ -280,4 +280,4 @@ int SinglePinI2SDriver::getUnderflowCount() // Global instance SinglePinI2SDriver I2SDriver; -#endif // defined(ESP8266) \ No newline at end of file +#endif // defined(ESP8266) diff --git a/src/libflac/stream_decoder.c b/src/libflac/stream_decoder.c index ec172fe..20ae399 100644 --- a/src/libflac/stream_decoder.c +++ b/src/libflac/stream_decoder.c @@ -2199,14 +2199,14 @@ FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder) * Three kinds of things can go wrong when reading the frame header: * 1) We may have sync'ed incorrectly and not landed on a frame header. * If we don't find a sync code, it can end up looking like we read - * a valid but unparseable header, until getting to the frame header + * a valid but unparsable header, until getting to the frame header * CRC. Even then we could get a false positive on the CRC. - * 2) We may have sync'ed correctly but on an unparseable frame (from a + * 2) We may have sync'ed correctly but on an unparsable frame (from a * future encoder). - * 3) We may be on a damaged frame which appears valid but unparseable. + * 3) We may be on a damaged frame which appears valid but unparsable. * * For all these reasons, we try and read a complete frame header as - * long as it seems valid, even if unparseable, up until the frame + * long as it seems valid, even if unparsable, up until the frame * header CRC. */ @@ -2839,7 +2839,7 @@ FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data) * FLAC__STREAM_DECODER_UNPARSEABLE_STREAM and increment its * unparseable_frame_count. But there is a remote possibility * that it is properly synced at such a "future-codec frame", - * so to make sure, we wait to see many "unparseable" errors in + * so to make sure, we wait to see many "unparsable" errors in * a row before bailing out. */ if(decoder->private_->is_seeking && decoder->private_->unparseable_frame_count > 20) { @@ -3146,7 +3146,7 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s return false; } /* Now we need to get a frame. First we need to reset our - * unparseable_frame_count; if we get too many unparseable + * unparseable_frame_count; if we get too many unparsable * frames in a row, the read callback will return * FLAC__STREAM_DECODER_READ_STATUS_ABORT, causing * FLAC__stream_decoder_process_single() to return false. diff --git a/src/libhelix-mp3/RPSL.txt b/src/libhelix-mp3/RPSL.txt index d040a45..94b4458 100644 --- a/src/libhelix-mp3/RPSL.txt +++ b/src/libhelix-mp3/RPSL.txt @@ -201,7 +201,7 @@ and 3, above. 4.2 Compatible Source Licenses. Software modules that have been independently developed without any use of Covered Code and which contain no portion of the Covered Code, Modifications or other Derivative Works, but are used or combined -in any way wtih the Covered Code or any Derivative Work to form a larger +in any way with the Covered Code or any Derivative Work to form a larger Derivative Work, are exempt from the conditions described in Section 4.1 but only to the extent that: the software module, including any software that is linked to, integrated with, or part of the same applications as, the software diff --git a/src/libhelix-mp3/assembly.h b/src/libhelix-mp3/assembly.h index b9e46c5..5ad0f30 100644 --- a/src/libhelix-mp3/assembly.h +++ b/src/libhelix-mp3/assembly.h @@ -40,7 +40,7 @@ * * assembly.h - assembly language functions and prototypes for supported platforms * - * - inline rountines with access to 64-bit multiply results + * - inline routines with access to 64-bit multiply results * - x86 (_WIN32) and ARM (ARM_ADS, _WIN32_WCE) versions included * - some inline functions are mix of asm and C for speed * - some functions are in native asm files, so only the prototype is given here @@ -241,7 +241,7 @@ static __inline int MULSHIFT32(int x, int y) static __inline int FASTABS(int x) { - int t=0; /*Really is not necessary to initialiaze only to avoid warning*/ + int t=0; /*Really is not necessary to initialize only to avoid warning*/ __asm { eor t, x, x, asr #31 diff --git a/src/libhelix-mp3/scalfact.c b/src/libhelix-mp3/scalfact.c index 4937e45..d274b36 100644 --- a/src/libhelix-mp3/scalfact.c +++ b/src/libhelix-mp3/scalfact.c @@ -74,7 +74,7 @@ static const char SFLenTab[16][2] = { * Return: none * * Notes: set order of short blocks to s[band][window] instead of s[window][band] - * so that we index through consectutive memory locations when unpacking + * so that we index through consecutive memory locations when unpacking * (make sure dequantizer follows same convention) * Illegal Intensity Position = 7 (always) for MPEG1 scale factors **************************************************************************************/ diff --git a/src/libogg/README.md b/src/libogg/README.md index 63545e2..c3be014 100644 --- a/src/libogg/README.md +++ b/src/libogg/README.md @@ -7,7 +7,7 @@ Ogg project codecs use the Ogg bitstream format to arrange the raw, compressed bitstream into a more robust, useful form. For example, the Ogg bitstream makes seeking, time stamping and error recovery -possible, as well as mixing several sepearate, concurrent media +possible, as well as mixing several separate, concurrent media streams into a single physical bitstream. ## What's here ## @@ -18,7 +18,7 @@ use with Ogg bitstreams. Directory: -- `src` The source for libogg, a BSD-license inplementation of the public domain Ogg bitstream format +- `src` The source for libogg, a BSD-license implementation of the public domain Ogg bitstream format - `include` Library API headers diff --git a/src/libtinysoundfont/README.ESP8266 b/src/libtinysoundfont/README.ESP8266 index e88104d..1009f36 100644 --- a/src/libtinysoundfont/README.ESP8266 +++ b/src/libtinysoundfont/README.ESP8266 @@ -28,7 +28,7 @@ Even with the caching, it was found that SPIFFS, while having great functionality, was horrbly slow. So I wrote a new "faster" ROM filesystem called, surprisingly, FastROMFilesystem. https://github.com/earlephilhower/ESP8266FastROMFS -If you are getting choppy playback, try this new filesytem or using a SD +If you are getting choppy playback, try this new filesystem or using a SD card (not tested by myself, but it'd be hard top be slower than SPIFFS). Simply going from SPIFFS to FastROMFilesystem took my testing of FURELISE.MID and 1MGM.SF2 from 0.5x realtime to 2.5x (i.e. from unusable diff --git a/src/libtinysoundfont/tsf.h b/src/libtinysoundfont/tsf.h index 4ac232d..bdaadae 100644 --- a/src/libtinysoundfont/tsf.h +++ b/src/libtinysoundfont/tsf.h @@ -104,7 +104,7 @@ TSFDEF tsf* tsf_load(struct tsf_stream* stream); // Free the memory related to this tsf instance TSFDEF void tsf_close(tsf* f); -// Stop all playing notes immediatly and reset all channel parameters +// Stop all playing notes immediately and reset all channel parameters TSFDEF void tsf_reset(tsf* f); // Returns the preset index from a bank and preset number, or -1 if it does not exist in the loaded SoundFont @@ -201,7 +201,7 @@ TSFDEF void tsf_channel_set_tuning(tsf* f, int channel, float tuning); TSFDEF void tsf_channel_note_on(tsf* f, int channel, int key, float vel); TSFDEF void tsf_channel_note_off(tsf* f, int channel, int key); TSFDEF void tsf_channel_note_off_all(tsf* f, int channel); //end with sustain and release -TSFDEF void tsf_channel_sounds_off_all(tsf* f, int channel); //end immediatly +TSFDEF void tsf_channel_sounds_off_all(tsf* f, int channel); //end immediately // Apply a MIDI control change to the channel (not all controllers are supported!) TSFDEF void tsf_channel_midi_control(tsf* f, int channel, int controller, int control_value); diff --git a/src/opusfile/opusfile.h b/src/opusfile/opusfile.h index 7a64572..11cc07a 100644 --- a/src/opusfile/opusfile.h +++ b/src/opusfile/opusfile.h @@ -729,7 +729,7 @@ struct OpusServerInfo{ /**The software used by the origin server (Server). This is NULL if there was no Server header.*/ char *server; - /**The media type of the entity sent to the recepient (Content-Type). + /**The media type of the entity sent to the recipient (Content-Type). This is NULL if there was no Content-Type header.*/ char *content_type; @@ -1436,7 +1436,7 @@ void op_free(OggOpusFile *_of); Some of these functions may be used successfully on the partially open streams returned by op_test_callbacks() or one of the associated convenience functions. - Their documention will indicate so explicitly.*/ + Their documentation will indicate so explicitly.*/ /*@{*/ /**Returns whether or not the stream being read is seekable. diff --git a/tests/common.sh b/tests/common.sh index cabad51..25c05cd 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -58,7 +58,7 @@ function build_sketches() local sketchdirname=$(basename $sketchdir) local sketchname=$(basename $sketch) if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then - echo "Skipping $sketch, beacause it is not the main sketch file"; + echo "Skipping $sketch, because it is not the main sketch file"; continue fi; if [[ -f "$sketchdir/.test.skip" ]]; then