Wave Shield: Seamless loop attainable?

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
xl97
 
Posts: 201
Joined: Mon Jul 27, 2009 12:51 pm

Wave Shield: Seamless loop attainable?

Post by xl97 »

Title says it all. :)

Can/Has anyone got the Wave Shield to play a .wav file in a seamless loop? (ever?)

Or better yet, -IS- there a way?

Files play... files can be triggered, files will even loop.... but not seamlessly/gapless.

There is always a small 'break' (hiccup) when the sound file starts over.

I have tried many sound files... even ones that were engineered to be seamless in looping playback (.wav file works in other hardware as a seamless/gapless loop)..

So my question is:

1.) Has anyone done it?
2.) How?
3.) Is it even possible with this product? (hardware/software lib)?

Or is there another lib to use to achieve this? or perhaps an edited version of the waveHC that allows this?


Thoughts:

About why it doesnt work?

Perhaps some sort of metadata/header in the file? (although as mentioned some audio files created for seamless playback work fine other hardware...just not with the Wave shield)

Mods? Any thoughts or feedback on this? perhaps a working example (video if you HAVE accomplished it?)

thanks!
-xl

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Wave Shield: Seamless loop attainable?

Post by adafruit_support_mike »

The gap will be the result of buffer latency.

The Wave Shield works by loading data from the SD card in bursts, then transmitting that to the DAC at the appropriate playback rate. It takes a certain amount of time to do that, so gaps in filling the buffer will translate to gaps in the audio output.

A seamless playback function would seek() the file pointer back to the beginning of the file once it reached the end, rather than closing the file and making you reopen it.

I don't think the WaveHC library has built-in support for that.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Wave Shield: Seamless loop attainable?

Post by pburgess »

Not built-in, no. It's theoretically possible, but you'd have to rewrite a lot of code at a very low level.

Have a look at the NeoPixel Painter project in the Adafruit Learning System. This does a thing at startup where an image file is converted to a contiguous range of blocks, so no seeking is necessary when it's repeated...it's just straight-up raw block reads at that point. You'd need to do something similar, but with WAV files.

User avatar
xl97
 
Posts: 201
Joined: Mon Jul 27, 2009 12:51 pm

Re: Wave Shield: Seamless loop attainable?

Post by xl97 »

Thanks for the reply guys...

Unfortunately thats beyond my skillset at the moment! (and free time lately) :)

bummer there is not built in support for this type of feature... :(


anyways-

appreciate the confirmation

take care

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

Return to “Arduino Shields from Adafruit”