I am having a bit of trouble getting the Fez Music Shield to do exactly what I want.
First, I want to say that this works perfectly for playback and I have had no issues with the sound quality for recording or playback. This is a 1 month old Fez Music Shield (VS1053) sandwiched between a Panda II (SDK V1.0.19) and a Fez Connect . I also have a LED and Button on unused ports (Di5/Di0).
Using the source code from Driver — FEZ MUSIC SHIELD as well as Driver – Music Shield Extension Playing Steams I have things basically working:
• Starts up and initializes everything, mounts SD, opens FileStream for recording
• Prints Testing recording and calls RecordOggVorbis with stream and waits 30 seconds.
• I believe the next 9 seconds are spend loading the record patch from the OGG array
• For (9s < t < 30s) I get some hiss from speaker (music shield output pin) and it records about 21 seconds of sound.
• Then it finishes up writing the record buffer and closes the file. The file is fine
• I added a bit of code to play the newly recorded file. That works fine too.
I would like to record sound the moment the user presses a button, but it takes too long to initialize the record (mainly loading the patch). The documentation implies that this needs to be done each time. I would like to quickly switch between record/play/record/play. The ADPCM patch is smaller – I have not tried that. It would be nice to pre-load the patch once and then just activate recording when needed.
I eventually want to load the patch from SD – Im hitting memory issues with the array declared in my full project. I am guessing it will not be much slower (30k in less than 9 seconds should be fine). I’m sure I can figure that part out.
Im not sure how to minimize the speaker hiss is during recording. I have not experimented enough. I should try setting the volume to 0. I dont know if it is related to sound from the line-in. Im using low-volume earphone output as line-in during testing, so maybe that is messing things up.
It would be really nice to record and playback at the same time. I could not find any information about a full duplex mode. I know the soft-reset at the beginning/ending of record could not happen.
Does anyone have some wisdom here? I think I have a pretty good understanding of how the vs1053 works (I did a quick read of the vs1053 manual & the VobOrbitz recording manual)