JOAL学习笔记
由于是概念介绍文章,没有提供实例,这里给出一个我的测试用例,它是在第一课的基础上修改的。
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.ByteBuffer;
import com.jogamp.openal.AL;
import com.jogamp.openal.ALFactory;
import com.jogamp.openal.util.ALut;
public class SingleStaticSource {
static AL al = ALFactory.getAL();
// Buffers hold sound data.
static int[] buffer = new int[1];;
// Sources are points emitting sound.
static int[] source = new int[1];
// Position of the source sound.
static float[] sourcePos = { 0.0f, -10.0f, 0.0f };//这里对其速度进行设置,此时相对速度为10个单位,改变+、-号来控制频移方向
// Velocity of the source sound.
static float[] sourceVel = { 0.0f, 20.0f, 0.0f };//这里将声源的位置改变,此时距离听众20个单位。
// Position of the listener.
static float[] listenerPos = { 0.0f, 0.0f, 0.0f };
// Velocity of the listener.
static float[] listenerVel = { 0.0f, 0.0f, 0.0f };
// Orientation of the listene

本文是JOAL学习笔记的第七课,重点介绍了多普勒效应。讲解了JOAL中声源与听众速度如何影响声音频率,并非位置。提到了实现多普勒效应的条件,包括声源与听众的位置差异、相对速度以及单声道音频缓冲区。还讨论了OpenAL中物理量与现实的差异,速度改变频率但位置需外部过程调整。
最低0.47元/天 解锁文章
1143

被折叠的 条评论
为什么被折叠?



