WavePlayerSdAccess.spin error
smithdavidp
Posts: 146
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)
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
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.
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
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