Re: [Super-tux-devel] stereo sound patch. Stereo effect issue
Brought to you by:
wkendrick
From: Duong-Khang N. <neo...@us...> - 2003-12-29 00:02:16
|
> Duong-Khang NGUYEN <neo...@us...> writes: > > 2. Adds: Stereo sound effects. In "gameloop.c" the kicked laptop now > > produces stereo sound depending on the position of SuperTux > > I don't think that the position of Tux itself should be used for > calculating the sound position, but instead the center of the > screen/camera. After all the view of the player and Tux are not really > the same, even so there are pretty close most of the time. I don't agree with your opinion since in SuperTux, you have your eyes stuck on Tux and it makes sense to calculate the sound panning from the tux's position. Just imagine that you have your Tux at the left hand side on the screen and there's a bad guy at your right hand side. However since the bad guy is in the left half of the screen you play the sound at the left speaker (IOW, all the panning effects to the left). The sound let you think that there's another bad guy who is coming from the left of Tux whereas the bad guy is just there at your right hand side. It will lead to confusion I think. > > 3. Changes: "play_sound( Mix_Chunk * snd)" > > now is "play_sound( Mix_Chunk * snd, enum Sound_Speaker whichSpeaker > > )" where whichSpeaker is > > SOUND_CENTER_SPEAKER, > > SOUND_LEFT_SPEAKER, > > SOUND_RIGHT_SPEAKER > > Why limit the sound to just three enums? Wouldn't it be better to have > a play_sound(Mix_Chunk* snd, float pos) and thus allow sound to be > positioned exactly, instead of being one speaker or the other Why only three enums ? It's because the others are NOT really useful. Here are the reasons: the panning effects are simulated by manipulating the left and the right channel volumes. If you give the left volume 60% and the right volume 40% of the total volume power in order to "position" exactly the effects, the sound produced is not that stereo. In addition, with the music turned on, you won't be able to distinguish obviously the effects. I've just unplugged my laptop from the Home Threater System to test this and the effects are nearly unrecognizable. > (center > will never be reached, since tux_x won't be equal to bad_guy_x in > practice)? Yes, but hardly. I didn't compare "tux_x" and "bad_guy_x" but "tux_x + scroll_x" and "bad_guy_x". I think I'll put some toleration or interval for the center panning to improve it. I think you have some confusion between the sound panning effects and the sound's attenuation effect. In fact, the sound panning plus the sound's attenuation can help simulating the sound position. Currently, there's only sound panning implemented. Maybe I'll combine the sound's attenuation effect in the near future ... > -- > WWW: http://pingus.seul.org/~grumbel/ > JabberID: gr...@ja... > ICQ: 59461927 -- Never say if I could turn back the time, life is going on ! |