Shop OBEX P1 Docs P2 Docs Learn Events
Trouble Getting WAV Player to play audio from SD Card — Parallax Forums

Trouble Getting WAV Player to play audio from SD Card

iexpressiexpress Posts: 2
edited 2015-01-16 13:20 in Learn with BlocklyProp
Hi All,

I am trying to run a quick test to play a wav from SD Card on the Human Interface Board using the Simple IDE example file, but the DAC isn't pumping out any voltage. I also picked up an Activity Board, but it arrived dead and won't even turn on. What a waste of $50.

The code looks like this per the example, but I changed the filename to another wave.
If there is a String datatype, couldn't that work for this example file?

The best option would be to write bytes directly to one of the DAC channels but I can't seem to find any documentation on most of the components of the Parallax boards to get them working properly.
.
Thanks:

int DO = 0, CLK = 1, DI = 2, CS = 3; // SD I/O pins
sd_mount(DO, CLK, DI, CS); // Mount SD card

const char levels[] = {"0000001D.WAV"}; // Set up levels string
wav_play(levels); // Pass to wav player

wav_volume(6); // Adjust volume
pause(500); // Play for 5 s

Comments

  • NWCCTVNWCCTV Posts: 3,629
    edited 2015-01-16 13:16
    If you have hardware issues I would call tech support directly. They are VERY good about resolving issues such as this.
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-01-16 13:20
    Have you tried one of the sample WAV files from the Parallax website? It's possible the WAV player doesn't understand the format in your file. Maybe sd_mount or wav_play is failing. Try printing the function return values to see if they are correct.
Sign In or Register to comment.