• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mobile App sound not working on a my device

Hi,
I ve developed an app which triggers the sound in the device. The sound is coming fine in other devices except "Micromax Bharat 2" which has Marshmallow OS.

How to solve this issue.?
Help me please.
 
A couple of things you could try:-

- Connect the real device to your computer and run your run your app on it from Android Studio. Do you see any errors?
- If you don't have the physical device, try running your app on an emulated device running the same version of Android. Does it work? Do you get any errors?

(Moved thread to Android Development forum)
 
A couple of things you could try:-

- Connect the real device to your computer and run your run your app on it from Android Studio. Do you see any errors?
- If you don't have the physical device, try running your app on an emulated device running the same version of Android. Does it work? Do you get any errors?

(Moved thread to Android Development forum)


Thanks for your reply.
I dont see any errors.Just the sound is not coming.
But it is coming in other devices except the one I have mentioned.
 
Code:
public static  void play(int sound, int number){
   AudioManager am = (AudioManager)Util.context.getSystemService(Util.context.AUDIO_SERVICE);
//AlermManager
       float audioMaxVolume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
       
       //Audio Manager
        float audioCurrentVolume = am.getStreamVolume(AudioManager.STREAM_MUSIC);
        float volumnRatio = audioCurrentVolume/audioMaxVolume;
        sp.play(
            suondMap.get(sound), //Id
            audioCurrentVolume,
            audioCurrentVolume,
            1,
            number,
            1);
    }
 
Last edited by a moderator:
So what piece of code calls the play() method? What class is it in?
Have you verified that this method gets called by setting a breakpoint here?
Have you stepped though the code to verify proper code execution?
 
Back
Top Bottom