PaulStoffregen
Well-known member
i'm simply trying to loop a file but it's only ever playing once. then things stop entirely:
Opps, that's a bug. I just pushed a fix to github.
https://github.com/PaulStoffregen/Audio
i'm simply trying to loop a file but it's only ever playing once. then things stop entirely:
AudioSynthWaveform myTone(AudioWaveformSine);
I just checked the waveforms on a scope, and yes indeed, there are problems at higher frequency. Visually, it looks like the amplitude is somewhat unstable, but if I get the triggering just right, it's clearly some low frequency content superimposed on the waveform.
Looks like I have quite a bit more work to do on this......
Edit: Maybe instead of a fixed table, these objects will need to take a reference to an object that's a collection of tables to be used in different frequency ranges.
.
Edit: Maybe instead of a fixed table, these objects will need to take a reference to an object that's a collection of tables to be used in different frequency ranges.
Some additional resources that may be useful:
* Cross-platform morphing Wavetable maker (zip file) requires SciLab to run.
I just checked the waveforms on a scope, and yes indeed, there are problems at higher frequency. Visually, it looks like the amplitude is somewhat unstable, but if I get the triggering just right, it's clearly some low frequency content superimposed on the waveform
mxxx I don't know, I stopped at the 'will need to install SciLab, do that later' step. I don't actually have any of his modules though I hear they are good.
Got a link to the processing sketch that does band-limiting? (Presumably it makes a continuous version then re-samples?)
AudioOutputPWM pwmOutput;
The "arbitrary waveform generator" is never quite in reach. We always have bandwidth and noise limitations. A true sawtooth and square wave alas
are impossible to make.
I'm wondering, ARM math has fft does it have ifft too? Maybe possible to do that processing on the teensy itself (not in real time, but it could write the results to flash or SD for later use).it takes a single cycle .wav runs an fft, removes the upper partials, then ifft. and so on, recursively.
What's the best way to convert from a lower sample rate to 44.1 kHz? Or what's the fastest, or best trade-off?
I'm working on playing slower sample rate WAV files, like 8 kHz sample rate. Right now, I'm working on simply playing some samples 5 times, others 6 times, to at least get _something_ working.
Surely there must be better ways. A couple quick searches have turned up a lot of stuff about fairly complex filtering....
What's the best way to convert from a lower sample rate to 44.1 kHz? Or what's the fastest, or best trade-off?
I'm working on playing slower sample rate WAV files, like 8 kHz sample rate. Right now, I'm working on simply playing some samples 5 times, others 6 times, to at least get _something_ working.
Yes, the proper way resamples it to the analog domain as a continuous waveform then resamples it.Surely there must be better ways. A couple quick searches have turned up a lot of stuff about fairly complex filtering....
} else if (rate == 22050) {
int16_t s0, s1, s2, s3, s4;
s0 = prior;
if (bits == 8) {
for (i=0; i < AUDIO_BLOCK_SAMPLES; i += 8) {
tmp32 = *in++;
s1 = (int8_t)((tmp32 >> 0) & 255) << 8;
s2 = (int8_t)((tmp32 >> 8) & 255) << 8;
s3 = (int8_t)((tmp32 >> 16) & 255) << 8;
s4 = (int8_t)((tmp32 >> 24) & 255) << 8;
*out++ = (s0 + s1) / 2;
*out++ = s1;
*out++ = (s1 + s2) / 2;
*out++ = s2;
*out++ = (s2 + s3) / 2;
*out++ = s3;
*out++ = (s3 + s4) / 2;
*out++ = s4;
s0 = s4;
}