Shop OBEX P1 Docs P2 Docs Learn Events
Wav playing help, please — Parallax Forums

Wav playing help, please

ErlendErlend Posts: 612
edited 2013-01-15 23:30 in Propeller 1
A year ago I played wav from SD with no problems. Now, with a new setup I've spent hours and hours to try to get sound, and I really need help - again.
I've tried:
WavePlayerSDaccess (David Sloan)
SDwavPlay (Raymond Allen) (this was the one I used a year ago)
WAV-Player_DACEngine.spin (Kwabena)
-and SD_Card_Micro_01.spin (Greg Denson) for writing text to file

The set-up is on a Prof Dev board, and I am using the on-board audio amp

Troubleshooting done:
-put LEDs on the SD pins - yes there is modem-like activity for Kwabena's, with the other objects the LEDs are half-lit, except LED pinDO which is off
-put LEDs on the audio pins - no light
-written a text string to the SD - works fine
-tested o/p by connecting audio pins directly to aux in on my amplifier - no sound
-measured ac on the audio pins - there's ~1.6V dc, and no ac (using a multimeter)
-connected the speakers to my pod - sound is ok.
-run a simple 1000hz out spin code - speakers beep

Pins used:
PinSDdo = 14 - the 'base pin'
PinSDclk = 15
PinSDdi = 16
PinSDcs = 17
PinAUDIOr = 25 (changed to 8)
PinAUDIOl = 26 (changed to 9 )

The SD is a 2GB microSD from Scandisk and sits in the simple SDcard adaptor from Parallax
The wav file is a 16bit 44khz stereo file, which plays at approx 1400kb/s. Size approx 30MB. It plays fine on my pc.

I am concluding that communication with the SD works fine - to write a text, and that the Kwabena wav player keeps talking to the SD. Other than that I am at complete loss as what to do next.
Maybe someone could give me a tested demo&objects set of code, with the above pin assignment and the file called "wav.wav" - there must be something stupid I am doing.

Erlend

Comments

  • ErlendErlend Posts: 612
    edited 2013-01-12 07:59
    It works!!! What I did was to replace the wav file with an other file. The are the same format and both play fine on the pc. Beats me. Now the LED on the pinDO and pinDI are alight, and the other two are half-lit.
    It works, but I do not like magic in software. Btw, it is the Kwabena player that is running now.

    Erlend
  • RaymanRayman Posts: 14,665
    edited 2013-01-12 10:10
    Glad you figured that out.

    When I look at my old wav player now, I can see that it needs some improvements. Particularly in how you set the pins...
    I'll try to find time to fix it up...
  • JonnyMacJonnyMac Posts: 9,108
    edited 2013-01-12 19:12
    One thing to check is that you're using "clean" WAV files, that is, no metadata in the file. Some programs but it at the beginning, some at the end. You can use Audacity to strip it out.

    The PC has the horsepower to buffer the file and strip out this non-audio data, Propeller-based audio players do not. In my WAV object (used in the EFX-TEK AP-16+) the file will stop playing as soon as it hits a metadata chunk; if this chunk is at the very beginning of the file (just after the normal WAV header), the file will be there but will not play.
  • ErlendErlend Posts: 612
    edited 2013-01-13 02:20
    Thanks, now I've learnt one more thing to look out for.
  • ErlendErlend Posts: 612
    edited 2013-01-15 23:30
    I cleaned the wav files and made sure they were set to 16bit, and the wav played without any hickups. Still, the old files from last year - that will not play now - did play fine with SDwavPlay (Raymond Allen) then, but with WAV-Player_DACEngine.spin (Kwabena) they do not play. Still, I like Kwabena's better, so I'll use that one.
Sign In or Register to comment.