Shop OBEX P1 Docs P2 Docs Learn Events
Simple test or demo for audio? — Parallax Forums

Simple test or demo for audio?

Dan EDan E Posts: 61
edited 2010-12-11 21:59 in Propeller 1
Hi, I am trying to write an object that plays a WAV file from a SD card through a speaker attached to an audio power amplifier. As of right now, no sound comes out and I am trying to debug it. My amplifier circuit is pretty simple so I don't think that is the problem, so I figure it must be the pin assignments I used and/or I improperly used the OBEX code.

Is there a simple audio object or demo with pin assignments that could be used to help debug this problem? I would like to see if in fact it is my speaker, power amp circuit, pin assignment, or how I call up the file possibly, and learn how to properly execute this program.

I tried to use the wavePlayerSD and its included objects, although I could not see where I assign the pins I am using, and I am using just one speaker, it seems that that code and others are for 2 speakers.

Thanks,
Dan E

Comments

  • Bill HenningBill Henning Posts: 6,445
    edited 2010-12-11 09:46
    Here is a quick and dirty audio diagnostic I use for my boards:
    ' Quick&Dirty Audio diagnostic for PropCade @ Mikronauts.com
    pub audio_diag(pin)|f,q
      dira[pin]~~
      repeat f from 0 to 500
        repeat 10
          outa[pin]~~
          repeat f
          outa[pin]~
          repeat f
      repeat f from 500 to 0
        repeat 10
          outa[pin]~~
          repeat f
          outa[pin]~
          repeat f
    
  • RaymanRayman Posts: 14,889
    edited 2010-12-11 09:52
    I have a wav player in OBEX that plays an embedded file, so no SD card required...
  • Dan EDan E Posts: 61
    edited 2010-12-11 09:53
    Thanks, I'll try it out.
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-12-11 12:15
    Dan E: I noticed on the other thread you mentioned it was a 16 ohm speaker amplifier. What you require is an amplifier that works with an iPod equivalent (i.e. takes earphones as inputs). Is this what you have?
  • Dan EDan E Posts: 61
    edited 2010-12-11 17:56
    Yes, it's actually a requires a stereo audio cable, but I cut the cord so that I could wire it to my audio output pin, only to reveal there are 3 wires, red, black and blue.

    I assume red is for power, black for ground, leaving blue as the input, but the device already has a 9volt supply, so I'm a little puzzled,

    My ipod headphone jack is a little smaller, than this cord, but maybe I can find a better match at radio shack.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-12-11 17:59
    Hey Dan,

    Just a quick caution. If you are using headphones to the Propeller, do a quick test to make sure that the output is at a safe level for your ears. I've gotten some unregulated audio from my Propeller that really smarted.

    OBC
  • Dan EDan E Posts: 61
    edited 2010-12-11 18:01
    Actually, I just checked, and you're right, it is wxactly the same as my ipod headphones, still puzzled as to the correct connection for the 3 wires though.
  • Dan EDan E Posts: 61
    edited 2010-12-11 18:03
    will do, the device I have is a mini amplifier speaker from radioshack, luckily with a volume control.
  • Dan EDan E Posts: 61
    edited 2010-12-11 21:59
    Figured out what the 3 wires were by cutting apart my ipod headphones, and the stereo audio jack.

    Although the cable i bought had a jack on each end, the wiring was for a right and left speaker or headphone, which corresponded to the wiring of my ipod headphones, and the other wire was soldered to the isolated ground of the jack.
Sign In or Register to comment.