Shop OBEX P1 Docs P2 Docs Learn Events
WavePlayerSdAccess.spin error — Parallax Forums

WavePlayerSdAccess.spin error

smithdavidpsmithdavidp Posts: 146
edited 2012-08-30 17:46 in Robotics
pub pwrite(ubuf, count)
writefunc
return sd.pwrite(ubuf, count)

pub pputc(c)
writefunc
return sd.pputc(c)

Pub SDStr(ptr) <
gives me an " Expected subroutine name " error. This is a Method called by WaveExample.spin
writefunc
sd.SDStr(ptr)

PUB SDdec(value)
writefunc
sd.SDdec(value)

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-04 11:18
    Check that you have the spelling correct and that the name isn't used for anything else.
  • smithdavidpsmithdavidp Posts: 146
    edited 2012-05-04 12:23
    Hi Mike,
    I did that. It isn't my code. It jumps quite a bit between methods. The starting method being WaveExample which calls FullDuplexSerial (pretty sure you are familiar with that one) and WavePlayerSdAccess which calls fsrw, wave_asm, and wav_decoder. fsrw calls safe_spi

    They are all code I D/L'd from OBEX. It seems strange that a sound file would be a string though. Seems it would be a long if anything. As you know I am just learning here. But I have gone through all the methods and that line has the only reference to SDStr. My first thought was that it could be in the WAV assembler or the WAV decoder but there was nothing there.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-04 13:22
    You may have gotten the error message pointing to the wrong line. Try "sd.str" which is the usual name for this routine.
  • smithdavidpsmithdavidp Posts: 146
    edited 2012-05-04 13:30
    Same error Mike.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-05-04 17:17
    I've (recently) successfully compiled that project, and had no problem. I would recommend you trash the current folder, re-download the file, and unzip it again. Before making any edits do a compile as a sanity check. You can then make modifications to suit your hardware. If the error crops up again it was some change you made.

    You may not want to bother, though. This version of WAV player is known to have problem with files sampled at higher bit rates -- it misreads and/or miscalculates the bitrate information and plays these files too slowly. You can do a forum search here to see the couple of other posts on it. Happened to me, too.

    You might try Kwabena's WAV player, which has routines for changing the playback rate. Ray Allen's WAV player examples are also good. Be sure your WAV files do not have any extra metadata stored with them (artist, genre, etc.). They also need to be a specific format (bitrate, mono/stereo), as indicated in the comments section at the top.

    -- Gordon
  • smithdavidpsmithdavidp Posts: 146
    edited 2012-05-05 01:58
    I have D/L'd the Kwabena's WAV file so I'll let you know how that turns out. It finally has become apparent to me that the Eddie platform is the only way to go for me. What I have been trying to do is going to require some PC intervention anyway. I have purchased everything and the total cost is still under my $5,000.00 dollar mark anyway. The Eddie platform also opens up some new avenues that I had not considered before. The Microsoft Health program will connect directly to the "Blue Button" system that the Veterans Administration uses. All of my vitals can be uploaded directly to the "My Health-E-Vet" web site. My perscriptions can also be ordered in the same manor through the same portal. Ordered the Eddie which wasroughly 1.4k (with shipping), the new PC which was about 1.6k and the Kinect sensor which was about $120.00. My wallet has divorced me but that's okay. I am still going to be learning the spin code and how to work with the Propeller. After all the Eddie's sensors and drive system is a Prop base system. If, or when, I get the system to work right then I may be able to demo it to the VA so that it can bennifit other Veterans out there.
  • smithdavidpsmithdavidp Posts: 146
    edited 2012-05-05 03:24
    The program worked Gordon but there is an awful lot of static in the background. Is this noise from the prop trying to play a background WAV along with the WAV that it obtained from the uSD card?
  • smithdavidpsmithdavidp Posts: 146
    edited 2012-05-05 03:42
    The thought occured to me that the static was comming from an empty Right channel. I disabled pin 27 (R/H channel) and the sound was very clear. Need to tweak the volume, and mod the code to fit my purpose, and I'm good to go. Thanks for the GREAT! help.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-05-05 10:44
    I think I mentioned this before: from the schematics, pin 27 is the left channel. The standard is tip=left, ring=right, sleeve=ground. The documentation also indicates this. Normally it's not a problem if R and L get mixed up, but if you really have a stereo signal with only one channel, disabling the wrong pin will result in no sound.

    That said, if you went from a monoaural track, there should be sound coming from both sides. I haven't looked closely at Kwabena's object, but I would assume he reads the WAV header to determine mono/stereo, and if mono, applies the same samples to both pins 26 and 27.

    -- Gordon
  • KyeKye Posts: 2,200
    edited 2012-05-05 10:51
    That's correct.
  • jcullins0jcullins0 Posts: 10
    edited 2012-08-30 17:46
    Never mind
Sign In or Register to comment.