Floris
Floris

Reputation: 1123

Where can I download the native Android .ogg files?

I am trying to support from API level 14 in my app, but the MediaActionSound class is only supported from API level 16. I found out that I can use this code snippet to play the required sound:

int currentApiVersion = android.os.Build.VERSION.SDK_INT;
        if (currentapiVersion >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            maSound = new MediaActionSound();
            maSound.load(MediaActionSound.FOCUS_COMPLETE);
        } else {
            SoundPool soundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0);
            int shutterSound = soundPool.load(this, R.raw.focus_complete, 0);  
        }

where R.raw.focus_complete is the reference to the audio .ogg file for that sound.

However I do not know where to download the standard .ogg files for the sounds FOCUS_COMPLETE and START_VIDEO_RECORDING.

Can anyone refer me to the URL or is there an alternative way to do this?

Thanks!

Upvotes: 1

Views: 1986

Answers (2)

Paul Chana
Paul Chana

Reputation: 11

I have the path where OGG files go... On your Android Device...

  1. navigate to /System/Media/Audio/Ringtones.

  2. Do the same as above for MP3's.

Enjoy!

Upvotes: 1

ben75
ben75

Reputation: 28726

Take a quick look into MediaActionSound.java. You have this :

private static final String[] SOUND_FILES = {
    "/system/media/audio/ui/camera_click.ogg",
    "/system/media/audio/ui/camera_focus.ogg",
    "/system/media/audio/ui/VideoRecord.ogg",
    "/system/media/audio/ui/VideoRecord.ogg"
};

So it seems you can use this load method :

soundPool.load("/system/media/audio/ui/VideoRecord.ogg",1);

Upvotes: 1

Related Questions