wavebeem

world wide weirdo

ย 

๐Ÿ’• @hauntedlatte

๐Ÿ  portland, or, usa

๐Ÿ“† mid-30s

๐Ÿ’ฌ here to make friends and chat

ย 


ย 

๐ŸŽฎ video games
๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป web development
๐Ÿ‘ฉ๐Ÿปโ€๐Ÿซ teaching others

ย 


ย 

๐ŸŽจ digital aesthetics
๐Ÿ’…๐Ÿป makeup & jewelry
๐Ÿ‘— gothic fashion
๐Ÿ‘ฉ๐Ÿปโ€๐ŸŽจ making pixel art

ย 


ย 

๐Ÿค˜๐Ÿป progressive metal
๐ŸŽธ video game music

ย 


ย 

๐ŸŸข everything green
๐ŸŒŸ neon colors and transparent plastic

ย 


blog + rss
wavebeem.com/
discord
@wavebeem

wavebeem
@wavebeem

and the "audio converter" for node.js i just installed... literally doesn't convert files between formats? i just looked at the source code and found it uselessly converts the file to base64 and then back to bits again??

what a night

zsh: file public/cry/1.mp3          
public/cry/1.mp3: Ogg data, Vorbis audio, mono, 32728 Hz, ~86000 bps, created by: Xiph.Org libVorbis I (1.3.4)
                                                                                                 
zsh: file public/cry/1.ogg
public/cry/1.ogg: Ogg data, Vorbis audio, mono, 32728 Hz, ~86000 bps, created by: Xiph.Org libVorbis I (1.3.4)

wavebeem
@wavebeem
/* eslint-disable no-console */
import fs from "fs";
import path from "path";
import { execFileSync } from "child_process";

const CRY_SRC = "public/cry";
const CRY_DEST = "public/cry";

export async function convertAudio() {
  for (const name of fs.readdirSync(CRY_SRC)) {
    if (!name.endsWith(".ogg")) {
      continue;
    }
    const baseName = path.basename(name, ".ogg");
    const fullName = path.join(CRY_SRC, name);
    const outputName = path.join(CRY_DEST, `${baseName}.mp3`);
    if (!fs.existsSync(outputName)) {
      console.log("Converting", fullName, "...");
      execFileSync("ffmpeg", ["-v", "quiet", "-y", "-i", fullName, outputName]);
    }
  }
}
syntax highlighting by codehost

You must log in to comment.

in reply to @wavebeem's post:

yeah so apparently i can't figure out the mp3 quality options and i'm really crunching the bits down. so i made it convert to aac instead since safari loves aac anyways. every other browser can play ogg like nice little webizens.

not at all! i do as much data processing statically as possible

https://github.com/wavebeem/pkmn.help/tree/master/bin

there's a ton of scripts that i manually run when i want to update data

they're all quite slow, so i don't even run them on build. they just download json, merge and simplify it, download images, convert image formats, download audio, and convert audio all developer side

then i just add the assets to the git commit and they're all deployed statically to netlify


stuff related to searching the pokedex and selecting types is all client side, though, so it's as fast as possible. and because i would need to generate 420 trillion combinations to do it all statically haha. and i'm specifically avoiding doing server side computation since it would make the project more
expensive to run!


https://github.com/wavebeem/pkmn.help/blob/master/bin/lib/convertAudio.ts

here's the audio converter function that i run from a script