You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear Everybody,
I am trying to play a sound file in AndAR program. but it looks some conflict.I
am trying to follwoing two way to solve conflict.
option :1
package edu.dhbw.andar.sample;
public class CustomObject extends ARObject {
private Context context;
@Override
public final void draw(GL10 gl) {
super.draw(gl);
MediaPlayer mp = MediaPlayer.create (this,context.raw.coconut);
mp.start();
......................
........................
//draw the box
box.draw(gl);
}
here the problem is, when marker detct the program is auto exit. I think the
problem is context.
option 2:
package edu.dhbw.andar.pub;
public class CustomActivity extends AndARActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
CustomRenderer renderer = new CustomRenderer super.setNonARRenderer(renderer);
try {
....................................
MediaPlayer mp = MediaPlayer.create(this,R.raw.coconut);
....}
here I used parameter "this" instead of "context" in create function. now
program not crash/auto exit. But in draw function, how i can execute folowing
line to play sound?
public final void draw(GL10 gl) {
super.draw(gl);
box.draw(gl);
mp.start();
because in draw function, mp is unresloved as the declaration problem.
So plese help me to solve this conflict/declaration problem to play sound..
Thanks
Rassall
Original issue reported on code.google.com by rassall....@gmail.com on 18 Aug 2010 at 7:58
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
rassall....@gmail.com
on 18 Aug 2010 at 7:58The text was updated successfully, but these errors were encountered: