Hello,
I'd like to know if it's possible to play an audio file (WAV, MP3, FLAC) in reverse playback (like a vinyl turntable or DJ) on the VS1005/1063?
I'd like to use this function to make a multiplayer project with speed/shifter and reverse playback.
Thanks for your help.
Reverse playback VS1005/1063
Re: Reverse playback VS1005/1063
Most formats cannot be played in reverse order without first decoding them and storing the result (in significant chunks).
To reverse play without decoding the whole file first would need to decode from the end of the file to the front. You could do this with linear PCM WAV and vs1005 with a special decoder which reads the file from back to front in blocks and reverses the samples in each block.
For compressed formats it is hard or impossible. One big issue is knowing where the block boundaries are. For most compressed formats you would need to scan the file from the beginning to the end and remember each block boundary. For some formats you cannot determine the boundaries without decoding the actual data. Some formats like Mp3 have dependencies between blocks, so they cannot always be decoded independently. All transfer codecs use windowing between frames, and from back to front the result won't be quite the same as from front to back.
FLAC has a very large block size and channels are not interleaved. The first channel needs to be fully decoded before anything can be output while decoding the second channel. If the second channel needs to be fully decoded too, you need even more memory.
To reverse play without decoding the whole file first would need to decode from the end of the file to the front. You could do this with linear PCM WAV and vs1005 with a special decoder which reads the file from back to front in blocks and reverses the samples in each block.
For compressed formats it is hard or impossible. One big issue is knowing where the block boundaries are. For most compressed formats you would need to scan the file from the beginning to the end and remember each block boundary. For some formats you cannot determine the boundaries without decoding the actual data. Some formats like Mp3 have dependencies between blocks, so they cannot always be decoded independently. All transfer codecs use windowing between frames, and from back to front the result won't be quite the same as from front to back.
FLAC has a very large block size and channels are not interleaved. The first channel needs to be fully decoded before anything can be output while decoding the second channel. If the second channel needs to be fully decoded too, you need even more memory.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Re: Reverse playback VS1005/1063
Can you tell me more about linear PCM WAV and vs1005 with a special decoder that reads the file from back to front in blocks and inverts the samples in each block?
If I can do this with a simple WAV file, I'd be delighted.
What special decoder are you talking about?
If I can do this with a simple WAV file, I'd be delighted.
What special decoder are you talking about?
Re: Reverse playback VS1005/1063
The player would be a reimplementation of the wav decoder. You need to read the RIFF WAVE header to get all of the information (sample rate, number of channels, bytes per sample, start and size of the data), then you can seek in the data chunk and read and play accordingly.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Re: Reverse playback VS1005/1063
I don't understand?
I have to rewrite all the code myself ?
To read the header of a WAV file, I can use the library supplied with the VS1005, but to read a WAV sample in reverse, I don't see how I can do it ?
I have to rewrite all the code myself ?
To read the header of a WAV file, I can use the library supplied with the VS1005, but to read a WAV sample in reverse, I don't see how I can do it ?