VS1053 Codec: Doing other stuff in recording loop?

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
shubhamgandhi
 
Posts: 10
Joined: Sun Jul 01, 2012 8:49 pm

VS1053 Codec: Doing other stuff in recording loop?

Post by shubhamgandhi »

I'm using the VS1053 Codec breakout board to record .ogg audio. The part of the library code in the main void loop() looks like this:

Code: Select all

void loop()
...
  if (isRecording)
    saveRecordedData(isRecording);
...
Can I do other stuff in the loop while the recording is going on? Something like this:

Code: Select all

void loop()
...
  if (isRecording)
    saveRecordedData(isRecording);

  value = ADC_Read(A5);
  if(value = 100)
    do something;
...
How long can I wait before the recording buffer fills up and needs to be flushed? Can I increase the buffer size to put more code in the record loop?

Thanks

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: VS1053 Codec: Doing other stuff in recording loop?

Post by adafruit_support_rick »

The buffer on the VS1053 is 8KB. You can't change the size of it. Changing the size of the buffer on the Arduino will have no effect.
How long you can go before you have to empty the VS1053 buffer depends on your sample rate and quality

According to Section 2.2.1 of the VS1053 Ogg Vorbis Encoder app note: at the 44.1kHz mono sample rate/quality factor 05 used in the record_ogg sample sketch, there's enough room in the internal buffer for about 700ms of recording time.
http://www.adafruit.com/datasheets/Vorb ... er170c.pdf

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”