<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Throwing something else out there: looking at d_soundfiler.c, it looks like it wouldn’t be that hard to add a second outlet that could send out the number of channels and samplerate of the loaded file. As far as I can tell, the number of channels is already read, so it involves reading the samplerate. This would allow for the calculation of the correct playback speed for samples irregardless of source & playback samplerates.<div class=""><br class=""></div><div class="">WAVE:</div><div class=""><br class=""></div><div class="">The samplerate is the 4 bytes after the number of channels in the WAVE fmt chunk. Ref: <a href="http://www.lightlink.com/tjweber/StripWav/Canon.html" class="">http://www.lightlink.com/tjweber/StripWav/Canon.html</a><br class=""><div class=""><br class=""></div><div class="">AIFF:</div><div class=""><br class=""></div><div class="">The samplerate is the last field in the COMM (Common) chunk. </div><div class=""> <div class="">typedef struct {</div><br class="Apple-interchange-newline"><div class="">     ID              ckID;</div><div class="">     long           ckSize;</div><div class="">     short          numChannels;</div><div class="">     unsigned long  numSampleFrames;</div><div class="">     short          sampleSize;</div><div class="">     extended   sampleRate;</div><br class="Apple-interchange-newline"><div class="">}  CommonChunk;</div></div><div class=""><br class=""></div><div class="">Ref: <a href="http://www-mmsp.ece.mcgill.ca/documents/audioformats/aiff/Docs/AIFF-1.3.pdf" class="">http://www-mmsp.ece.mcgill.ca/documents/audioformats/aiff/Docs/AIFF-1.3.pdf</a></div><div class=""><br class=""></div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">--------<br class="">Dan Wilcox<br class=""><a href="https://twitter.com/danomatika" class="">@danomatika</a><br class=""><a href="http://danomatika.com" class="">danomatika.com</a><br class=""><div class=""><a href="http://robotcowboy.com" class="">robotcowboy.com</a></div></div>

</div>
<br class=""></div></div></body></html>