Hi, there.
I'm trying to use the sound file with redering objects in FrameMarkers.
For example, a snowman is rendering with carrol song.
switch (marker->getMarkerId())
{
case 0:
vertices = &QobjectVertices[0];
normals = &QobjectNormals[0];
indices = &QobjectIndices[0];
texCoords = &QobjectTexCoords[0];
numIndices = NUM_Q_OBJECT_INDEX;
break;
case 1:
vertices = &CobjectVertices[0];
normals = &CobjectNormals[0];
indices = &CobjectIndices[0];
texCoords = &CobjectTexCoords[0];
numIndices = NUM_C_OBJECT_INDEX;
break;
case 2:
vertices = &AobjectVertices[0];
normals = &AobjectNormals[0];
indices = &AobjectIndices[0];
texCoords = &AobjectTexCoords[0];
numIndices = NUM_A_OBJECT_INDEX;
break;
default:
vertices = &RobjectVertices[0];
normals = &RobjectNormals[0];
indices = &RobjectIndices[0];
texCoords = &RobjectTexCoords[0];
numIndices = NUM_R_OBJECT_INDEX;
break;
}
Do i have to add code in this section?
if it's possible, give me some tips, please. :)
That's correct, I believe sound must be handled by the Android SDK in Java, not native. You can use the JNI (Java Native Interface) to make calls from native back up to Java to play a sound. We should have a sample application that demonstrates this in the coming weeks.
The code you posted is the point where you could call up to Java to play a sound, depending on which frame marker is visible. It is also the right place to bind your own vertex arrays, etc. depending on what you want to render.
- Kim