Shop OBEX P1 Docs P2 Docs Learn Events
Waveplayer wont play! Help needed — Parallax Forums

Waveplayer wont play! Help needed

BotdocterBotdocter Posts: 271
edited 2010-04-14 00:49 in Propeller 1
I tried every wave player in the obex. And i think the code is running because i can hear a hiss. But i can't get it to play a wave. I connected everything as it should be. Pin 10/11 for audio and 0123 for the uSD card reader.

What could be the problem?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 Parallax Propeller Robot Control Board
1 Memsic MX2125 accelerometer/ tilt
1 Parallax Ping))) ultrasonic sensor

a few motors and a whole lot of chaos!

Comments

  • RaymanRayman Posts: 15,406
    edited 2010-04-13 01:40
    I have one wave player that plays directly from an embedded file in HUB RAM. I think it's called 8-bit mono...
    See if you can get that one to work first...

    What does your audio circuit look like?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • BotdocterBotdocter Posts: 271
    edited 2010-04-13 02:14
    I have a set of external walkman speaker connected to 5v pin.
    Audio through pin 10/11

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 Parallax Propeller Robot Control Board
    1 Memsic MX2125 accelerometer/ tilt
    1 Parallax Ping))) ultrasonic sensor

    a few motors and a whole lot of chaos!
  • DonEduardoDonEduardo Posts: 54
    edited 2010-04-13 02:47
    Seems like you are missing a few external components. In all the wav players I've worked with you're required to put an Resistor-capacitor filter plus a DC blocking capacitor in series with the pins. You usually can't connect the pins directly to an amplifier. The schematic is usually in the opening comments of the driver file.
  • BotdocterBotdocter Posts: 271
    edited 2010-04-13 03:05
    Well, maybe you're right, but it works fine when i use one of the speech synthesis demos.

    Can it have something to do with the sectorsize? I tried to format it to fat16 512size but my pc said it is a too small value for this type of medium. So i selected 32k instead and changed it in the code too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 Parallax Propeller Robot Control Board
    1 Memsic MX2125 accelerometer/ tilt
    1 Parallax Ping))) ultrasonic sensor

    a few motors and a whole lot of chaos!
  • BotdocterBotdocter Posts: 271
    edited 2010-04-13 12:38
    I have tried the 8 bit mono code and it does play something. It sounds like calling a fax machine. I used a 8 bit pcm mono @ 700 hrz.

    Any idea's??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 Parallax Propeller Robot Control Board
    1 Memsic MX2125 accelerometer/ tilt
    1 Parallax Ping))) ultrasonic sensor

    a few motors and a whole lot of chaos!
  • RaymanRayman Posts: 15,406
    edited 2010-04-13 13:09
    Make sure the clkfreq and PLL settings match the crystal you're using...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    My Prop Products:· http://www.rayslogic.com/Propeller/Products/Products.htm
  • BotdocterBotdocter Posts: 271
    edited 2010-04-13 17:51
    They do match, anything else?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 Parallax Propeller Robot Control Board
    1 Memsic MX2125 accelerometer/ tilt
    1 Parallax Ping))) ultrasonic sensor

    a few motors and a whole lot of chaos!
  • rokickirokicki Posts: 1,000
    edited 2010-04-13 20:25
    Botdocter said...
    Well, maybe you're right, but it works fine when i use one of the speech synthesis demos.

    Can it have something to do with the sectorsize? I tried to format it to fat16 512size but my pc said it is a too small value for this type of medium. So i selected 32k instead and changed it in the code too.

    There's "sector size"---which is *always* 512 for SD, with no way to change it---and "cluster size"---which should be 32K
    but can be as small as 512.

    In the Prop code, typically, sector size is fixed at 512 (because that's all that works) and cluster size is determined
    dynamically from the file system on the card (because that's how you read FAT volumes).

    If you changed any code, I recommend starting from scratch, only change the necessary things (like pins).

    -tom
  • BotdocterBotdocter Posts: 271
    edited 2010-04-13 20:36
    Will try that!

    Thanx!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1 Parallax Propeller Robot Control Board
    1 Memsic MX2125 accelerometer/ tilt
    1 Parallax Ping))) ultrasonic sensor

    a few motors and a whole lot of chaos!
  • DonEduardoDonEduardo Posts: 54
    edited 2010-04-13 23:59
    If I understood your earlier post, you tried Rayman's 8bit mono code which plays a file from memory, and that did not produce a recognizable sound (sounded like a fax sound you said which probably is not what it's supposed to sound like) . If so, I would again suggest the RC network before the amplifier. I've never been able to get any sound from the wav players without that in place. Look at Kwabena's wav player in the Obex. He talks about it in the forum's somewhere too and provides example code. He has a schematic for the RC filter in the comments section and the object he wrote to read the SD files prints a lot of stuff to the terminal screen so you can probably better see where the problem is. His code gives you a command prompt where you can list files and then play them.
  • KyeKye Posts: 2,200
    edited 2010-04-14 00:49
    http://forums.parallax.com/showthread.php?p=889772

    Cheers.

    Note: RTFM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
Sign In or Register to comment.