Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by WalterBright

13 hours ago

A .wma music file is just an array of values ranging from -x to +x. Above a certain threshold, replace it with 1. Below, replace it with 0.

Now feed the 1s (+5V) and 0s (0V) into the speaker at the same rate as the sampling in the .wma file.

Since the speaker cone has inertia, the result will be an approximation of the original waveform, rather than a square wave.

0 comments

WalterBright

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities