  | |  | Various sound problems | Various sound problems 2004-01-22 - By Joakim Birgersson
Back I have been wondering about clicks-on-volume-change for a while since I'm getting clicks/cracking sounds in a hobby project I'm doing. I have read that most software sound/music mixers (for example .MOD/.XM players) uses volume ramping to avoid clicks on volume change.
I assume a "ramp" is a interpolation from a current volume/data-value to a actual volume/data-value so it happens over time, avoiding quick changes (?) I have a couple of question I hope someone has the knowledge and time to answer.
1) What do you ramp, is it the volume (as in playing a sample at volume=90 and then a new at volume=10) or is it the byte/word data in the wave-form?
Say I'm playing a sample (signed 16-bit output) and stops it to play a new sample. The last word in the first sample outputted was -32000 and the first word in a new sample is +32000. Now, when I stop the first sample to play the second sample there will be a 64000 jump in the value outputted.
The first sample play at volume=90 and the second at volume=10. There will be a -80 volume jump.
What should I ramp? The volume from 90 to 10 or the word data from -32000 to +32000?
2) How fast should one ramp? How quick can the volume/data change without clicks? Is it hardware dependant and in that case, what is practical?
Regards, Joackim
>From: Dietrich Epp <dietrich@(protected)> >To: Mac Games Developers Developers <mac-games-dev@(protected)> >Subject: Re: Various sound problems >Date: Wed, 21 Jan 2004 20:47:05 -0800 > >On Jan 20, 2004, at 9:02 PM, Ken Pajala wrote: > >>I'm having various problems with sounds and I'm wondering if anyone else >>has >>experienced these problems or has an idea of what I might be doing wrong. >>I've asked on the QuickTime-api list as well, but with not much luck so >>far... >> >>First: loading sounds from a file (aiff or mp3) causes iTunes to make >>clicking/crackling noises. I'm basically using QuickTime (through >>PutMovieIntoTypedHandle) to load the files. I filed a bug with Apple on >>this >>one a couple months ago. >> >>Second: playing a sound many times (around twice a second) eventually >>makes >>iTunes crackle as well. With this problem and the next one it doesn't >>matter >>if I'm playing a sound loaded from a resource or a file. >> >>Third: ramping the volume up or down using multiple calls to >>SndDoImmediate >>with volumeCmd causes the same crackling noise many times a second (with >>or >>without iTunes playing). > >Pardon the ASCII art. >Sine wave: > _ _ >/ \ / \ > \_/ \_/ > >Sine wave with volume change: > > V > _ _ > _ _| \ / \ >/ \ / | | | > \_/ | | > \_/ > >Notice the jump underneath the 'arrow'... this is a loud 'pop'. According >to the diagram's scale, this is an increase of only 3 dB, but the crackling >noise is exactly as loud as the new, louder sound. > >As for the first and second problems, I have no idea what you're doing. >iTunes is crackling? So iTunes is playing in the background, and your >application loads a sound? > >Are you using double buffering to play your sounds? >__ ____ ____ ____ ____ ____ ____ ____ ____ ____ >mac-games-dev mailing list | mac-games-dev@(protected) >Help/Unsubscribe/Archives: >http://www.lists.apple.com/mailman/listinfo/mac-games-dev >Do not post admin requests to the list. They will be ignored.
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail __ ____ ____ ____ ____ ____ ____ ____ ____ ____ mac-games-dev mailing list | mac-games-dev@(protected) Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac -games-dev Do not post admin requests to the list. They will be ignored.
Earn $52 per hosting referral at Lunarpages.
|
|
 |