changing pitch of audio samples - TeensyVariablePlayback library

@horstmaita, I've taken a look at starting playback from an arbitrary point in the sample file: you can find the first try on a new branch in my fork.

To use it, set up your playback objects as usual, but before you start playback, call something like playSdWav1.setPlayStart(play_start_arbitrary,22050);. This will cause playback to begin 22050 samples from the start of the file, i.e. 0.5 seconds in at the default sample rate of 44.1kHz. You still can't make a sudden jump in playback position while playing, though. Also, there's something wrong with stereo playback - I need to look into this further.
Today I tested the AudioPlaySerialFlashResmp and the sound goes really bad when setting pitch up (only one semitone and has distortion/artefacts... ) which does not happen with the SD player. Also in the serial flash player, with this last release my teensy gets stuck if I try to play with the loop on, this does not happen with the previous one.
 
Today I tested the AudioPlaySerialFlashResmp and the sound goes really bad when setting pitch up (only one semitone and has distortion/artefacts... ) which does not happen with the SD player. Also in the serial flash player, with this last release my teensy gets stuck if I try to play with the loop on, this does not happen with the previous one.
You might want to try increasing the number of buffers and their size in ResamplingSerialFlashReader.h:
Code:
#define RESAMPLE_BUFFER_SAMPLE_SIZE 512
#define RESAMPLE_BUFFER_COUNT           7
This might help the "sound goes really bad", could help the loop issue too. I don't have serial flash fitted so can't test this anyway, so won't bug you about the Forum Rule to post a small complete program that compiles with the Arduino IDE and demonstrates the issue...
 
Back
Top