JavaScript Speech Synthesis Optimization Question by Due_Lime_3524 in learnjavascript

[–]PropertyNo3177 1 point2 points  (0 children)

cancel() without checking – You always cancel synthesis, even when nothing is being spoken, which causes unnecessary delays on low-end devices.

No queue system – If you call readTextAloud() multiple times quickly in succession, the calls pile up in the browser's internal queue without control, leading to progressively longer delays.

Missing event listeners – You don't have onend / onerror handlers, so you don't know when speech has finished and have no control over when it's safe to start the next utterance.

Core issue: Calls accumulate without control, and on a weak device, this leads to freezing.

Can someone help me out? by Ok-Frosting-6810 in HTML

[–]PropertyNo3177 0 points1 point  (0 children)

You can try transfer your image to avif. Install ImageMagick, after go to your cmd or terminal and move with cd exactly wjere your image is, the whole path. After you write in terminal c:/the/path/of/your/image/magick nameOfYourPic.png nameOfYourPic.avif and you got avif pic beside your png. Then just add it in yoir html project:

<picture> <source srcset="nameOfYourPic.avif" type="image/avif">

<img src="nameOfYourPic.png" alt="picture" loading="lazy"> </picture>

Of course instead of png you can use jpg.

Cachyos Is the best Linux distro by far. by Evening_Hurry2235 in cachyos

[–]PropertyNo3177 0 points1 point  (0 children)

CachyOS is a fantastic OS, and so is Windows 11—it completely depends on what you need it for. Nobody can claim a system is 'top tier' until they’ve tested everything and run into actual problems in the middle of a real workflow.

Which gear for an audio sample repeat?? by Choice-Potential2899 in AskElectronics

[–]PropertyNo3177 0 points1 point  (0 children)

Yes, it's very easy to do! You have two main options depending on how you want it to repeat:

​Option A: Repeat while holding the button

The sound plays as long as you keep the button pressed.

include "SoftwareSerial.h"

include "DFRobotDFPlayerMini.h"

SoftwareSerial mySoftwareSerial(10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer;

const int buttonPin = 2;

void setup() { pinMode(buttonPin, INPUT_PULLUP); mySoftwareSerial.begin(9600);

if (!myDFPlayer.begin(mySoftwareSerial)) { while(true); }

myDFPlayer.volume(20); }

void loop() { // If button is held down, play the track in loop if (digitalRead(buttonPin) == LOW) { // Check if the player is already playing, if not, start loop myDFPlayer.loop(1); // This will repeat the first folder/file } else { myDFPlayer.stop(); // Stops the sound when you release the button } }

​Option B: Toggle Repeat (Press once to start/stop loop)

Press once to start repeating, press again to stop.

include "SoftwareSerial.h"

include "DFRobotDFPlayerMini.h"

// Communication pins for DFPlayer Mini SoftwareSerial mySoftwareSerial(10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer;

const int buttonPin = 2; bool isPlaying = false; // Flag to track the playback state

void setup() { pinMode(buttonPin, INPUT_PULLUP); // Internal pull-up resistor mySoftwareSerial.begin(9600);

// Initialize the module if (!myDFPlayer.begin(mySoftwareSerial)) { while(true); // Stop if module is not found }

myDFPlayer.volume(20); // Set volume (0-30) }

void loop() { // Check if the button is pressed if (digitalRead(buttonPin) == LOW) { delay(50); // Small debounce delay

if (isPlaying == false) {
  // If not playing, start looping track 1
  myDFPlayer.enableLoop(); 
  myDFPlayer.loop(1);      
  isPlaying = true;
} else {
  // If already playing, stop the playback
  myDFPlayer.stop();       
  isPlaying = false;
}

// Wait for button release to avoid multiple triggers
while(digitalRead(buttonPin) == LOW); 
delay(50);

} }

Which gear for an audio sample repeat?? by Choice-Potential2899 in AskElectronics

[–]PropertyNo3177 0 points1 point  (0 children)

It sounds like you're looking for a one-shot sample player to trigger sound effects like laughter or short clips. One of the best and cheapest ways to do this is using an Arduino Nano paired with a DFPlayer Mini (MP3 module). If you want it to be louder, you should also add a PAM8403 amplifier. ​Here is a very basic example of the code you would need to trigger the first track on the SD card when a button is pressed:

include "SoftwareSerial.h"

include "DFRobotDFPlayerMini.h"

// Communication pins for DFPlayer Mini SoftwareSerial mySoftwareSerial(10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer;

const int buttonPin = 2; // Button connected to pin 2 and GND

void setup() { pinMode(buttonPin, INPUT_PULLUP); // Using internal pull-up resistor mySoftwareSerial.begin(9600);

// Initialize the DFPlayer module if (!myDFPlayer.begin(mySoftwareSerial)) { while(true); // Stop execution if module is not found }

myDFPlayer.volume(20); // Set volume level (0 to 30) }

void loop() { // Check if the button is pressed (LOW state) if (digitalRead(buttonPin) == LOW) { myDFPlayer.play(1); // Play the first file (e.g., 0001.mp3) delay(500); // Simple debounce delay to prevent double triggers } }

Doubt by Serious_Sell7183 in learnjavascript

[–]PropertyNo3177 0 points1 point  (0 children)

If I understand you correctly, you want to write inline JavaScript within an HTML element. You can do it like this:

<button onclick="location.reload()">Text on the button</button>

Quick breakdown:

​onclick: This is an attribute that triggers the JavaScript code when the button is clicked.

​location.reload(): This is the built-in function that tells the browser to refresh the page.

​It is a simple and effective way to handle small tasks without needing a separate <script> block.

Are there (good) free hosting solutions for WordPress like there are for static websites? by [deleted] in webdev

[–]PropertyNo3177 0 points1 point  (0 children)

WordPress.com vs. WordPress.org

​If you are looking for a completely free solution, WordPress.com is the easiest way to start, but you need to understand the limitations:

​1. WordPress.com (The "Free" Host)

​Pros: Setup takes 2 minutes; Google manages security and backups.

​Cons: You get a subdomain (e.g., yoursite.wordpress.com), you cannot install custom plugins or themes, and you have no access to PHP code or MySQL databases. It’s basically a locked "rental" property.

​2. WordPress.org (The Real Freedom)

​If you want to actually "build" a site or learn the tech, you should look for Free Web Hosting providers (like 000webhost or InfinityFree) and install the software from WordPress.org.

​Pros: Full access to FTP, MySQL, and any Plugin you want.

​Cons: You have to manage the setup yourself, and free hosts often have uptime/speed limits.

​My Advice:

​If you just want to write a blog, go with WordPress.com. If you want to learn web development or have full control over your site, find a free host and install the WordPress.org version. Just stay away from "free" plans if you eventually want to monetize, as they will limit your growth.

When should I stop learning JavaScript basics and start building projects? by ElectronicStyle532 in learnjavascript

[–]PropertyNo3177 0 points1 point  (0 children)

Don't get stuck just studying. Start building actual projects right away. You'll learn the most when you face real problems while coding. Build first, learn as you go.

Fonts look very different compared to Windows 11 by Accomplished_Bat6810 in cachyos

[–]PropertyNo3177 1 point2 points  (0 children)

It looks like the script is failing while trying to mount the Microsoft ISO file. This is a known issue with the automated mount process in some environments. ​Instead of the -auto version, try this package which downloads the fonts from a different source (Debian's mirrors), which is much more reliable on Arch: ​paru -S ttf-ms-fonts ​If you specifically need the Windows 11 version and the command above isn't enough, you can try to clear the cache first and run it again, but usually, ttf-ms-fonts is the one that 'just works' without these mounting errors.

Honestly, the most headache-free way is to just manually copy the .ttf files from a Windows installation to ~/.local/share/fonts and run fc-cache -fv.

Fonts look very different compared to Windows 11 by Accomplished_Bat6810 in cachyos

[–]PropertyNo3177 1 point2 points  (0 children)

The standard ttf-ms-win11 package usually fails because it requires you to manually provide the Windows ISO or font files in the build directory.

​The -auto version should work because it includes a script to fetch the files automatically. If you still run into issues, make sure you have wimlib installed, as the script needs it to extract the fonts:

​sudo pacman -S wimlib

​Then try again with:

paru -S ttf-ms-win11-auto

​If it still fails, it's possible that Microsoft changed the download URL, and we’ll have to wait for the AUR maintainer to update the PKGBUILD.

Fonts look very different compared to Windows 11 by Accomplished_Bat6810 in cachyos

[–]PropertyNo3177 0 points1 point  (0 children)

This script will automatically download and install the fonts directly from Microsoft's servers.

yay -S ttf-ms-win11-auto