Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help need!! can't play audio(sound file) with AndAR.... #31

Open
GoogleCodeExporter opened this issue Apr 5, 2015 · 3 comments
Open

Comments

@GoogleCodeExporter
Copy link

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

@GoogleCodeExporter
Copy link
Author

Yes Solved..Thanks Tdomhan for pingpong game where I get the idea to solve...

thanks

Original comment by rassall....@gmail.com on 19 Aug 2010 at 7:52

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

 Please help me..... how did u solve this issue?

Original comment by jaiv...@gmail.com on 9 Jan 2011 at 11:51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant