delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/31/03:00:26

From: "Steve Patton" <leaphe AT pemail DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Sample playback frequency change
Date: Sat, 31 Jan 1998 00:50:32 -0700
Organization: AT&T WorldNet Services
Lines: 18
Message-ID: <6aul51$qua@bgtnsc03.worldnet.att.net>
NNTP-Posting-Host: 12.67.33.41
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm using Allegro (has nothing to do with the question, but for anyone who
wants to know), and I have a sample that's recorded at 44100, and the only
playback hardware frequencies are 22727 and 45454 (rough estimate, I just
know that they aren't 22050 and 44100), I'm using the audiostream procedures
so that I can have direct control over the samples.  My question is, how
could I render something that's at one frequency, at another frequency,
without the actual sample changine, like if it were at 44100 and I wanted to
play it at 22050, I would simply just have it skip every other byte (or
short in 16-bit sapmles).  But since it's not even, what would be a good
algorithm to have it play at a different frequency.  And BTW, play_sample is
out of the question in this particular application.


--
-Steve
http://home.att.net/~pattonl


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019