Web Audio API in action (soundboard)

Yesterday I read a thread where somebody asked for a soundboard with sounds from typical montage parodies. Just asking for this I would probably skipped the thread but he also asked for an option for distorting the sound and this which got me interested.

I asked myself:

Is it possible to do this with HTML5 & JS alone?

At first I thought we need compression instead of overdrive, for some reason. So I looked around a bit and stumbled upon the Web Audio API. There’s a great tutorial about the Web Audio API out there which I would recommend you to check out. At first, I found it a bit confusing with all the nodes but the basic idea is pretty simple.

You have a source (e.g. audio file) and a destination (output). Now you can connect nodes between them. For example, gain nodes or compression nodes, etc. which is pretty cool.

It was a long way to…

In the beginning I just experimented a bit with the Web Audio API and tried to get it to work. This took me about 30 minutes or so then I experimented with nodes and tried different settings. Then it actually struck me that I don’t need compression but distortion, i.e. overdrive. Thankfully, there is a overdrive module for the Web Audio API. Which I added quickly and the audio part worked fine.

Let’s do the thing I hate the most

I build my last GUI about 2 or 3 years ago because I always hated it. I preferred to just make some command line interface and was happy with it. Nonetheless, I decided to try it and for the first time with bootstrap because I heard a lot of good about it.

So I downloaded the files and included the bootstrap-theme and … holy cow this is easy. I created my web interface in less than 10 minutes. Sure, it looks like every bootstrap application but it’s super easy. I really like it. For me it broke this spell that I just write my command line application and don’t publish it because I’m too lazy to build a GUI for it.

Results

You can test the soundboard for yourself (WARNING: It’s probably loud and lots of screaming). It works fine in Chrome, the newest Firefox and Safari. Opera doesn’t seem to work and IE doesn’t work.

I posted it 20 hours ago and since then I got about 1400 visits which is pretty nice for a four-hour project.

Just an experiment: AdSense

You’ve probably see that I included ads on this blog. It’s just an experiment and I wanted to test it.

The process

You start by writing your application for Adsense. This includes your blog address (which has to be hosted on a top level domain, e.g. example.org) and your private address. Then you have to wait. I waited about 5 days until I got a response. So check the adsense page  every day once. If Google approves you you can go to the next step.

Integrating

Integration is super easy  if you use the Google Publisher Plugin. All you got to do is install it and then connect your blog with your Adsense account. This takes maybe 30 – 60 seconds.

Now you can add ad spaces. I just took the recommended setting but you can choose your individual placement. And that’s it. Now you have to wait again until your ads spaces get approved.

Profit

Currently, I want to test this setting for 30 days, just to see if it makes any money. I’m thinking about donations because I know of a few people who are grateful for my content, especially the solutions to the algorithm design manual.

How to advance liberty through entrepreneurship

Today I just post a post I’ve written but I think people can profit from it. Enjoy.

 

You can advance the liberty in the world. How? Provide better alternatives. If you want to live on the frontier you must have the guts to do it. It’s nice to sit back and complain about all things in your home. Even better is getting out and doing something. I’m not talking about political action. I’m talking about entrepreneurial action.

It’s easy

I started my first business when I was about 15. Super simple, people had problems with their computers, I knew a bit about computers, they came to me with their problems and I fixed it. Made about $50 to $100 per customer.

A few years later I sold books, DVDs and CDs on amazon. Started with my own stuff, later family and friends of my family asked if I can sell theirs too. I just took a margin of the price when the product was sold and handled shipping and complaints. Easy money.

I don’t have any money

This is bullshit. You don’t need 500k to start a business, you don’t need investors, no VCs, no angels. There are pretty awesome methods out there to start businesses on a shoestring budget. Even easier I give you a few business ideas which you can start with under $100.

  • Teach older people how to use the internet / pc / write e-mails: They want to, but they don’t want to bug their children or grandchildren all the time. Make an easy package to decrease the risk, print some flyers (you can design them yourself at first and they will be pretty good if you consider a few principles) and put them into mailboxes. If you are successful enough and get the marketing figured out, you can easily employ students who do the teaching for you.
  • Flip stuff The basic idea is that you buy low and sell high. /r/flipping has lots of information about this. One technique I heard that works quite fine is to buy stuff in bulk (e.g. a CD collection of 60 CDs) and sell them individually. You can start with cheap stuff and work your way up.
  • Selling snacks I don’t know the US so take this with a grant of salt. One class mate did this and I thought it was pretty good. The students wanted snacks, the vending machine however was in the basement. People are lazy. He bought candy bars for about $0.30 each and sold them in class for $1. He started first with our class, then he expanded to other classes. He made about $50 – $100 a day while in school.

Innovative products

I can understand that these businesses sound boring but you will learn how businesses work. Secondly, they just work and make you money. There’s a lot less risk involved. If you have a great idea for a tech startup, start small. Build a great website – you can do this easily for under $100 bucks – and start testing your idea first. Get it on the market and let the market decide. You don’t need any programming skills up to this point. Build a mailing list for prospects. If you think you get enough (do some realistic projections) – start building your app. Again, start small. Solve the biggest problem first. I worked with a ton of different startups and mostly do it wrong. I worked with one startup who had superb PR, had about 12-20k visits per month and made about $200 per month. How? Their product was terrible, nobody wanted it. They invested over $250k in the company and three years later they were bankrupt. If they changed their product, but stayed in the same niche, they could easily have made $20k+ per month in sales.

Advancing liberty

Provide better alternatives. This doesn’t have to be your first business. Rather start accumulating resources first (knowledge, connections, money) and then advance your cause. If you can do both in this step, great. This step won’t be easy but there’s a lot less resistance than you think at first. A lot of self-employed people (not the super rich) don’t really like the gov or the “establishment”. You basically have two routes:

  • Replace an existing service
  • Provide a better interface

Let’s start with the latter because it’s shorter. Easy example for a better interface is a tax adviser. He’s a middle-man but his services are so valuable that you decide to hire him. This sector is pretty big and includes lawyers, labels, publishers, etc.

The former option is more interesting, however more risky. Some great examples are crowd funding instead of running to angels or VCs. Publishing platforms like Amazon instead of negotiating with publisher. Video platforms like Youtube instead of begging for a TV time slot.

Look around and list all the big corporations or government functions:

  • (G) Education
  • (G) Social security
  • (G) Security
  • (C) Energy (Oil & Gas)
  • (C) Transportation (Automotive)
  • (C) Financial services (Banks)
  • (C) Drugs (Pharmaceutical companies)
  • etc.

Take a deeper look at each one and understand the bigger problem they are trying to solve. Find ways to solve it with modern technology. For example, bank giving out loans? Why can’t people give out loans directly? P2P lending platforms.

You are going to start small, even if it isn’t that small but the forces from the gov can be pretty harsh – see P2P lending platforms or prediction markets. A great way around is using crypto currencies. You won’t destroy the gov but you can replace each part of it.

Holy shit, it really works (keto)

If you are familiar with reddit you may have heard of /r/keto. It is a subreddit where people talk and share their experiences with the ketogenic diet. I knew this subreddit for a long time because it often featured really fat people who got slim rather fast.

What will happen?

Someday while I browsing /r/keto I decided to just try it. The worst that could happen would be that I lost interest in it or that it didn’t work for me. My initial time limit was 4 weeks.

Thus, I calculated my macros (carbs, fat and protein). In the first 3 or so days I didn’t track anything and it also didn’t feel different. After that I started to get to do it seriously and tracked my food in myfitnesspal. I realized that my carb intake through vegs was simply too high.

I’m feeling sick

A few days later the infamous keto flu or carb flu hit me. This happens because you will at first lose a lot of water weight and this will wash out your electrolytes. Of course, the community had great tips and I drank about two to four cups of broth (with extra salt) everyday. And it worked. I no longer felt sick and now something strange happened.

Where does this energy come from?

The first day after my carb flu disappeared I woke up totally relaxed and full of energy. Really strange. I had no problems working out in the morning and eating a breakfast afterwards without collapsing. And this happened to me a few times while in school.

You don’t fart anymore

This is a really funny but interesting fact. It just stopped and my belly doesn’t feel bloated anymore. Some people basically stop eating fiber which can increase the time between poops. I however eat everyday at least 2g of fiber and my digestive systems works totally fine.

I don’t want to eat that anymore

About 2-3 weeks in I just wanted to stop keto. I wanted to eat pasta again and tons of fruits and all that. I was so tired of eating sausages, meat, and eggs all day. Again, I looked if other people had the problem. Of course. One of the most important things to realize in this stage is that you don’t eat food to satisfy your lust. You eat it to fuel your body. The first few days I just ate to get my macros and was done with it. But, afterwards, I enjoyed my food so much like I never did. The weight was lifted. I didn’t expect food to taste absolutely fantastic and it began to taste absolutely fantastic.

But it is expensive…?

I’m now 5 weeks in and a lot changed. Firstly, although the food is more expensive I spent less money because I just eat less. Before keto I basically ate all day. A snack here, a snack there. Now, I eat one to two meals a day. Mostly, one big meat meal and later a few hundred grams of green veggies.

Secondly, I lost about 20lbs in 5 weeks (from 222lbs to 202lbs). My belly fat reduced quite strongly. One of my first victories was that my t-shirt no longer rested on my belly but on my breast.

Thirdly, I’m no longer really hungry or carve food. It’s much more controlled and constant.

Fourthly, I’m more awake and don’t get super tired after eating meals. My energy level is pretty high all day.

Fifthly, I can eat lots of delicious food all day like beef, pork, sausages, bacon, eggs, salmon, trout, broccoli, spinach, chicken, … It’s freaking awesome!

Check out /r/keto if you’re interested and try it out. You will find all the information you need there.